Back to MCP directory
publicPublicdnsLocal runtime

dolphin-mcp

Dolphin-MCP是一个基于Model Context Protocol的语义代码搜索服务器,通过Dolphin API实现跨仓库的代码和文档智能检索,支持并行片段获取和多种过滤选项。

article

README

🚀 dolphin-mcp

dolphin-mcp 是用于 Dolphin 语义代码搜索的 MCP 服务器,它遵循 MCP 规范,能够帮助用户在代码搜索和知识查询方面提供高效的服务。

🚀 快速开始

无需安装,可直接使用 bunx

bunx dolphin-mcp

📦 安装指南

如果你希望全局安装:

bun install -g dolphin-mcp

安装完成后,使用 dolphin-mcp 替代 bunx dolphin-mcp

📚 详细文档

配置

Continue.dev

将以下内容添加到 config.yaml

mcpServers:
  - name: Dolphin-KB
    command: bunx
    args:
      - dolphin-mcp
    env:
      DOLPHIN_API_URL: "http://127.0.0.1:7777"
      # 可选:并行代码片段获取的性能优化
      MAX_CONCURRENT_SNIPPET_FETCH: "8"
      SNIPPET_FETCH_TIMEOUT_MS: "2000"
      SNIPPET_FETCH_RETRY_ATTEMPTS: "1"

Claude Desktop

将以下内容添加到 claude_desktop_config.json

{
  "mcpServers": {
    "dolphin-kb": {
      "command": "bunx",
      "args": ["dolphin-mcp"],
      "env": {
        "DOLPHIN_API_URL": "http://127.0.0.1:7777",
        "MAX_CONCURRENT_SNIPPET_FETCH": "8",
        "SNIPPET_FETCH_TIMEOUT_MS": "2000",
        "SNIPPET_FETCH_RETRY_ATTEMPTS": "1"
      }
    }
  }
}

环境变量

| 属性 | 详情 | |------|------| | DOLPHIN_API_URL | Dolphin API 端点,默认值为 http://127.0.0.1:7777 | | LOG_LEVEL | 日志级别(debug、info、warn、error),默认值为 info |

并行代码片段获取配置

这些变量用于控制 search_knowledge 中并行代码片段获取的性能优化: | 属性 | 默认值 | 描述 | 推荐范围 | |------|------|------|------| | MAX_CONCURRENT_SNIPPET_FETCH | 8 | 最大并行代码片段请求数 | 4 - 12 | | SNIPPET_FETCH_TIMEOUT_MS | 2000 | 每个代码片段请求的超时时间(毫秒) | 1500 - 3000 | | SNIPPET_FETCH_RETRY_ATTEMPTS | 1 | 失败请求的重试次数 | 0 - 3 |

配置预设

保守配置(适用于资源有限的情况):

MAX_CONCURRENT_SNIPPET_FETCH=4
SNIPPET_FETCH_TIMEOUT_MS=1500
SNIPPET_FETCH_RETRY_ATTEMPTS=1

推荐配置(性能均衡):

MAX_CONCURRENT_SNIPPET_FETCH=8
SNIPPET_FETCH_TIMEOUT_MS=2000
SNIPPET_FETCH_RETRY_ATTEMPTS=1

高性能配置(最大吞吐量):

MAX_CONCURRENT_SNIPPET_FETCH=10
SNIPPET_FETCH_TIMEOUT_MS=3000
SNIPPET_FETCH_RETRY_ATTEMPTS=2

可用工具

search_knowledge

对索引仓库中的代码和文档进行语义查询,并返回带有引用的排名代码片段。

{
  "query": "string (必需)",
  "repos": ["string"],
  "path_prefix": ["string"],
  "exclude_paths": ["string"],
  "exclude_patterns": ["string"],
  "top_k": "number (1 - 100)",
  "max_snippets": "number",
  "embed_model": "small | large",
  "score_cutoff": "number"
}

过滤选项

  • repos:仅包含特定的仓库
  • path_prefix:仅包含匹配这些前缀的路径(例如 ["src/", "lib/"]
  • exclude_paths:排除匹配这些前缀的路径(例如 ["tests/", "node_modules/", "dist/"]
  • exclude_patterns:排除匹配 glob 模式的文件(例如 ["*.test.ts", "*.config.json"]

示例

{
  "query": "身份验证逻辑",
  "repos": ["myapp"],
  "path_prefix": ["src/"],
  "exclude_paths": ["tests/"],
  "exclude_patterns": ["*.spec.ts", "*.mock.ts"]
}

fetch_chunk

通过 chunk_id 获取一个代码块,并返回带有引用的代码块。

{
  "chunk_id": "string (必需)"
}

fetch_lines

从磁盘获取文件的一个切片 [start, end](包含),并返回带有引用的代码块。

{
  "repo": "string (必需)",
  "path": "string (必需)",
  "start": "number (必需,从 1 开始编号)",
  "end": "number (必需,包含)"
}

get_vector_store_info

报告命名空间、维度、限制和近似计数。

{}

open_in_editor

计算一个 vscode://file URI,用于打开仓库路径和可选位置。

{
  "repo": "string (必需)",
  "path": "string (必需)",
  "line": "number (从 1 开始编号)",
  "column": "number (从 1 开始编号)"
}

🔧 技术细节

要求

📄 许可证

本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。

🔗 链接

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