Back to MCP directory
publicPublicdnsLocal runtime

Coding Project Structure

一个提供项目文件内容访问的MCP服务器,支持获取项目目录下所有文件及其内容。

article

README

🚀 项目内容服务器

项目内容服务器是一个MCP服务器,它为用户提供了访问项目文件及其内容的权限,方便对项目文件进行管理和使用。

🚀 快速开始

本项目是一个提供项目文件及其内容访问权限的MCP服务器。你可以通过以下步骤进行安装和使用。

📦 安装指南

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

💻 使用示例

基础用法

启动服务器:

node build/index.js

📚 详细文档

API

latest_project_data

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

参数:

  • projectPath (字符串):项目目录路径

示例请求:

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

示例响应:

{
  "file1.txt": "文件1的内容",
  "subdir/file2.js": "文件2的内容"
}

配置

服务器可以通过环境变量进行配置:

| 属性 | 详情 | |------|------| | PORT | 服务器运行的端口(默认:标准输出) |

错误处理

服务器返回错误信息的格式如下:

{
  "content": [{
    "type": "text",
    "text": "错误消息"
  }],
  "isError": true
}

常见的错误包括:

  • 无效的项目路径
  • 权限 denied 错误
  • 文件系统错误

📄 许可证

本项目采用MIT许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client