返回市场
MCP服务器

MCP服务器

作者:strands-agents218 星标更新:2025-11-22

项目介绍

<div align="center"> <div> <a href="https://strandsagents.com"> <img src="https://strandsagents.com/latest/assets/logo-github.svg" alt="Strands Agents" width="55px" height="105px"> </a> </div> <h1> Strands Agents MCP 服务器 </h1> <h2> 一种通过几行代码构建AI代理的模型驱动方法。 </h2> <div align="center"> <a href="https://github.com/strands-agents/mcp-server/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/strands-agents/mcp-server"/></a> <a href="https://github.com/strands-agents/mcp-server/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/strands-agents/mcp-server"/></a> <a href="https://github.com/strands-agents/mcp-server/pulls"><img alt="GitHub open pull requests" src="https://img.shields.io/github/issues-pr/strands-agents/mcp-server"/></a> <a href="https://github.com/strands-agents/mcp-server/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/strands-agents/mcp-server"/></a> <a href="https://pypi.org/project/strands-agents-mcp-server/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/strands-agents-mcp-server"/></a> <a href="https://python.org"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/strands-agents-mcp-server"/></a> </div> <p> <a href="https://strandsagents.com/">文档</a> ◆ <a href="https://github.com/strands-agents/samples">示例</a> ◆ <a href="https://github.com/strands-agents/sdk-python">Python SDK</a> ◆ <a href="https://github.com/strands-agents/tools">工具</a> ◆ <a href="https://github.com/strands-agents/agent-builder">代理生成器</a> ◆ <a href="https://github.com/strands-agents/mcp-server">MCP 服务器</a> </p> </div>

此 MCP 服务器通过 llms.txt 文件提供对您的 GenAI 工具的精选文档访问,使 AI 编码助手能够搜索并检索具有智能排名的相关文档。

功能

  • 智能文档搜索:基于TF-IDF的搜索,带有Markdown感知评分,优先考虑标题、标题和代码块
  • 精选内容:从 llms.txt 文件中索引文档,具有清晰易读的人类可读标题
  • 按需获取:仅在需要时懒加载完整文档内容以实现最佳性能
  • 片段生成:提供带相关性评分的上下文片段,以便快速概览
  • 实际URL支持:与实际HTTPS URL一起工作,同时保持向后兼容性

先决条件

以下使用方法需要在系统上安装 uv。您可以按照官方安装说明进行安装。

安装

您可以使用 Strands Agents MCP 服务器与 支持 MCP 服务器的40多种应用程序, 包括Amazon Q Developer CLI、Anthropic Claude Code、Cline 和 Cursor。

通过单击安装按钮快速开始使用流行的 MCP 客户端。点击下面的按钮直接在您的IDE中安装服务器:

在 Kiro 中安装 在 Cursor 中安装 在 VS Code 中安装

Kiro 示例

参阅Kiro 文档了解管理 MCP 配置的说明。

~/.kiro/settings/mcp.json 中:

{
  "mcpServers": {
    "strands-agents": {
      "command": "uvx",
      "args": ["strands-agents-mcp-server"],
      "env": {
        "FASTMCP_LOG_LEVEL": "INFO"
      },
      "disabled": false,
      "autoApprove": ["search_docs", "fetch_doc"]
    }
  }
}

Q Developer CLI 示例

参阅Q Developer CLI 文档了解管理 MCP 配置的说明。

~/.aws/amazonq/mcp.json 中:

{
  "mcpServers": {
    "strands-agents": {
      "command": "uvx",
      "args": ["strands-agents-mcp-server"],
      "env": {
        "FASTMCP_LOG_LEVEL": "INFO"
      },
      "disabled": false,
      "autoApprove": ["search_docs", "fetch_doc"]
    }
  }
}

Claude Code 示例

参阅Claude Code 文档了解管理 MCP 服务器的说明。

claude mcp add strands uvx strands-agents-mcp-server

Cline 示例

参阅Cline 文档了解管理 MCP 配置的说明。

向 Cline 提供以下信息:

我想添加 Strands Agents 的 MCP 服务器。
这是 GitHub 链接:@https://github.com/strands-agents/mcp-server
可以添加吗?

Cursor 示例

参阅Cursor 文档了解管理 MCP 配置的说明。

~/.cursor/mcp.json 中:

{
  "mcpServers": {
    "strands-agents": {
      "command": "uvx",
      "args": ["strands-agents-mcp-server"],
      "env": {
        "FASTMCP_LOG_LEVEL": "INFO"
      },
      "disabled": false,
      "autoApprove": ["search_docs", "fetch_doc"]
    }
  }
}

VS Code 示例

参阅VS Code 文档了解管理 MCP 配置的说明。

在您的 mcp.json 文件中:

{
  "servers": {
    "strands-agents": {
      "command": "uvx",
      "args": ["strands-agents-mcp-server"]
    }
  }
}

快速测试

您可以使用 MCP Inspector 快速测试 MCP 服务器:

# 对于已发布的包
npx @modelcontextprotocol/inspector uvx strands-agents-mcp-server

# 对于本地开发
npx @modelcontextprotocol/inspector python -m strands_mcp_server

注意:这需要在您的系统上安装npx,它捆绑在Node.js中。

Inspector 还可用于解决 MCP 服务器问题,因为它提供了详细的连接和协议信息。要深入了解,请查看MCP Inspector 文档

开始使用

  1. 安装先决条件

  2. 配置您的 MCP 客户端

    • 从上面的安装示例中选择您喜欢的 MCP 客户端
    • 将 Strands Agents MCP 服务器配置添加到您的客户端
  3. 测试连接

    # 对于已发布的包
    npx @modelcontextprotocol/inspector uvx strands-agents-mcp-server
    
    # 对于本地开发
    npx @modelcontextprotocol/inspector python -m strands_mcp_server
    
  4. 开始使用文档工具

    • 使用 search_docs 查找具有智能排名的相关文档
    • 使用 fetch_doc 从特定 URL 获取完整内容
    • 服务器会自动从 llms.txt 文件中索引精选内容

服务器开发

git clone https://github.com/strands-agents/mcp-server.git
cd mcp-server
python3 -m venv venv
source venv/bin/activate
pip3 install -e .

npx @modelcontextprotocol/inspector python -m strands_mcp_server

贡献 ❤️

我们欢迎贡献!请参阅我们的贡献指南了解详情:

  • 报告错误和功能
  • 开发设置
  • 通过拉取请求贡献
  • 行为准则
  • 安全问题报告

许可证

本项目根据 Apache License 2.0 授权 - 详情见LICENSE文件。

安全

更多信息请参阅贡献指南