返回市场
海豚-MCP

海豚-MCP

作者:plasticbeachllc2 星标更新:2025-11-21

项目介绍

dolphin-mcp

NPM 版本 许可证: MIT

用于 Dolphin 语义代码搜索的 MCP 服务器。符合 MCP 规范

快速开始

无需安装 - 使用 bunx

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_URLhttp://127.0.0.1:7777Dolphin API 终点
LOG_LEVELinfo日志级别(debug, info, warn, error)

并行片段获取配置

这些变量控制 search_knowledge 中并行片段获取的性能优化:

变量默认值描述推荐范围
MAX_CONCURRENT_SNIPPET_FETCH8最大并行片段请求4-12
SNIPPET_FETCH_TIMEOUT_MS2000每个片段请求超时时间(毫秒)1500-3000
SNIPPET_FETCH_RETRY_ATTEMPTS1失败请求重试次数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:排除匹配通配符模式的文件(例如,["*.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

计算一个 repo 路径的 vscode://file URI 和可选位置。

{
  "repo": "string (必需)",
  "path": "string (必需)",
  "line": "number (1开始计数)",
  "column": "number (1开始计数)"
}

安装(可选)

如果你希望全局安装:

bun install -g dolphin-mcp

然后使用 dolphin-mcp 替代 bunx dolphin-mcp

要求

  • Bun >= 1.0.0 - 安装
  • Dolphin API 在配置的端点上运行

许可证

MIT - 查看 LICENSE 文件以获取详细信息。

链接