Nia Codebase MCP

Nia 代码库 MCP

Nia Codebase MCP 服务器允许您通过 Cursor、Claude Desktop 和其他 MCP 兼容客户端等工具中的函数调用来集成 Nia 的代码库理解功能。

安装

您可以使用 npx 来使用此 MCP 服务器,而无需安装它:

npx -y nia-codebase-mcp@1.0.1 --api-key=YOUR_NIA_API_KEY --transport=stdio

交通选择

Nia Codebase MCP 服务器支持两种传输方式:

1. 标准输入/输出(stdio)-默认

这是默认的传输方法,在未指定传输时使用:

npx -y nia-codebase-mcp --api-key=YOUR_NIA_API_KEY

2. 服务器发送事件(SSE)

要使用 SSE 传输,请指定--transport=sse标志和可选端口(默认为 3000):

npx -y nia-codebase-mcp --api-key=YOUR_NIA_API_KEY --transport=sse --port=3000

在 MCP 客户端中的使用

光标

  1. 打开“游标设置”>“功能”>“MCP 服务器”
  2. 添加新的 MCP 服务器
  3. 名称: nia-codebase
  4. 类型: command
  5. 命令: npx -y nia-codebase-mcp@1.0.1 --api-key=YOUR_NIA_API_KEY

克劳德桌面

~/Library/Application Support/Claude/claude_desktop_config.json添加到您的 Claude Desktop 配置中:

{ "mcpServers": { "nia-codebase": { "command": "npx", "args": ["-y", "nia-codebase-mcp@1.0.1", "--api-key=YOUR_NIA_API_KEY"] } } }

对于 Windows 用户,配置位于%APPDATA%\Claude\claude_desktop_config.json

示例提示

Using the lookup_codebase_context tool, please analyze my project structure and tell me what the main components are.
Using the lookup_codebase_context tool, search the codebase to understand how the authentication system works and explain its key components.

调试

如果服务器无法正常工作,您可以启用调试模式:

npx -y nia-codebase-mcp@1.0.1 --api-key=YOUR_NIA_API_KEY --debug=true

环境变量

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

  • NIA_API_KEY :您的 Nia API 密钥
  • TRANSPORT :要使用的传输方法( stdiosse
  • PORT :用于 SSE 传输的端口(默认值:3000)
  • TOOL_TIMEOUT_MS :工具执行的自定义超时(默认值:300000ms)
  • DEBUG :启用调试模式( truefalse

工具

该 MCP 服务器提供以下工具:

  • lookup_codebase_context :从 Nia 索引的代码库中查找上下文,根据用户查询检索相关的代码片段。

要求

  • Node.js 18 或更高版本
  • 有效的 Nia API 密钥
  • Nia 中索引的代码库

执照

麻省理工学院

-
security - not tested
-
license - not tested
-
quality - not tested

MCP 服务器允许通过 Cursor 和 Claude Desktop 等工具中的函数调用与 Nia 的代码库理解功能集成,使用户能够分析项目结构并通过自然语言查询搜索代码库。

  1. Installation
    1. Transport Options
      1. 1. Standard Input/Output (stdio) - Default
      2. 2. Server-Sent Events (SSE)
    2. Usage in MCP Clients
      1. Cursor
      2. Claude Desktop
      3. Example Prompts
    3. Debugging
      1. Environment Variables
        1. Tools
          1. Requirements
            1. License
              ID: ukgqghf26m