项目内容服务器

一个提供项目文件及其内容访问的MCP服务器。

  • by MaheshDoiphode
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 MaheshDoiphode/mcp-cline-project-content-server

使用说明

项目内容服务器

提供对项目文件及其内容的访问的MCP服务器。

安装

  1. 克隆存储库
  2. 安装依赖项:
    npm install
    
  3. 构建项目:
    npm run build
    

用法

启动服务器:

node build/index.js

API

最新项目数据

从项目目录中获取所有文件及其内容。

参数:

  • projectPath (string):项目目录的路径

请求示例:

{
  "name": "latest_project_data",
  "arguments": {
    "projectPath": "/path/to/project"
  }
}

示例响应:

{
  "file1.txt": "Contents of file1",
  "subdir/file2.js": "Contents of file2"
}

配置

可以使用环境变量配置服务器:

  • PORT:运行服务器的端口(默认:stdio)

错误处理

服务器返回以下格式的错误:

{
  "content": [{
    "type": "text",
    "text": "Error message"
  }],
  "isError": true
}

常见错误包括:

  • 项目路径无效
  • 权限被拒绝错误
  • 文件系统错误

许可证

麻省理工学院