关于 Strands Mcp
Strands Mcp 抓取 Strands Agents 文档并将其索引到 Elasticsearch,供 Amazon Q Developer 搜索。它也可通过 FastMCP 提供 Web MCP 端点,并支持其他 MCP 客户端。
主要功能
- 01抓取 Strands Agents 文档
- 02将文档索引到 Elasticsearch
- 03提供全文搜索能力
- 04支持 FastMCP Web 服务和本地服务
- 05通过 Kibana 浏览索引数据
适用场景
- 01在 Amazon Q Developer 中查询文档
- 02通过 MCP 客户端搜索 Strands Agents 文档
- 03在 Kibana 中探索索引内容
MCP 相关
MCP 服务向 Amazon Q Developer 及其他兼容客户端提供 Elasticsearch 中已索引的 Strands Agents 文档。支持 Web 端点和 stdio 连接。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
面向 Amazon Q 的 Strands Agents MCP 服务
本项目提供一个 MCP(Model Context Protocol)服务,用于抓取 Strands Agents 文档并将其编入 Elasticsearch 索引,供 Amazon Q Developer 搜索。
架构
- 文档抓取器:用于爬取 Strands Agents 文档(v1.1.x)的 Python 脚本
- Elasticsearch 索引:存储抓取的文档,并提供全文搜索功能
- MCP 服务:为 Amazon Q 提供对已编入索引的文档的访问能力
- Docker Compose:编排所有服务
组件
scraper/- 文档抓取逻辑mcp_server/- MCP 服务实现elasticsearch/- Elasticsearch 配置docker-compose.yml- 服务编排
快速开始
选项 1:FastMCP Web 服务(推荐)
本项目现已支持通过 FastMCP 使用可通过 Web 访问的 MCP:
# Install UV if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Start Elasticsearch
docker-compose up -d elasticsearch
# Run scraper to populate data
uv run scraper
# Start web-accessible MCP server
uv run fastmcp-server
服务访问方式:
- MCP 端点:
http://localhost:8000/mcp/ - 面向 AI 客户端:连接任意兼容 MCP 的客户端
- 面向开发者:使用 FastMCP Client 库
UV 命令:
uv sync # Install/update dependencies
uv run scraper # Run scraper directly
uv run fastmcp-server # Run web MCP server
uv run mcp-server # Run local MCP server (stdin/stdout)
uv add <package> # Add new dependency
uv remove <package> # Remove dependency
选项 2:使用预先编入索引的数据(Docker)
docker/ 目录包含一个 Docker Compose 配置,其中有预先编入索引的 Strands 文档:
# Navigate to the docker directory
cd docker/
# Start all services (Elasticsearch, Kibana, and data restoration)
docker-compose up -d
# Wait for services to start (about 30-60 seconds)
# Check status
docker-compose ps
# Elasticsearch will be available on port 9200
# Kibana GUI will be available on port 5601
此配置包括:
- Elasticsearch,其中包含预先编入索引的 Strands 文档
- Kibana,用于数据可视化和探索
- 从
es-data.tar.gz自动恢复数据
选项 3:传统设置(根目录)
使用传统 Python 进行全新设置,不使用预先编入索引的数据:
# Start Elasticsearch and Kibana (from root directory)
docker-compose up -d
# Then run the scraper to index documentation
python scraper/main.py
在本地运行抓取器
使用 pip
# Install dependencies
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromium
# Run the scraper to index documentation
python scraper/main.py
使用 uv
# Install dependencies
uv sync
# Install Playwright browsers
uv run playwright install chromium
# Run the scraper to index documentation
uv run python scraper/main.py
在本地运行 MCP 服务
# Run the MCP server
python mcp_server/main.py
# The MCP server will be available on port 8000
配置
- Elasticsearch 索引:
strands-agents-docs - MCP 服务端口:8000
- Kibana GUI 端口:5601
- 文档来源:https://strandsagents.com/latest/documentation/docs/
使用 Kibana 查看数据
Kibana 提供基于 Web 的 GUI,用于探索和可视化 Elasticsearch 数据:
- 访问 Kibana:在浏览器中打开 http://localhost:5601(无需登录)
- 创建索引模式:
- 转到 Stack Management → Index Patterns
- 使用
strands-agents-docs创建新的索引模式 - 如果有
@timestamp字段,将其选为时间字段
- 探索数据:
- 使用 Discover 浏览和搜索抓取的文档
- 使用 Dashboard 创建数据可视化
- 使用 Dev Tools 直接运行 Elasticsearch 查询
快速探索数据
- Discover 选项卡:查看所有已编入索引的文档,并进行全文搜索
- 搜索:使用搜索栏查找特定文档内容
- 筛选器:应用筛选器,按字段缩小结果范围
- 时间范围:调整时间范围,查看文档的索引时间
与 Amazon Q 配合使用
将服务端点添加到 MCP 配置,即可配置 Amazon Q 使用此 MCP 服务。详细说明请参阅 AMAZON_Q_INTEGRATION.md。
与 Windsurf 配合使用
集成 Windsurf IDE,借助 Strands Agents 文档提升开发体验。设置说明请参阅 WINDSURF_INTEGRATION.md。
快速设置 Windsurf
# Copy the configuration file
cp windsurf-mcp-config.json ~/.windsurf/mcp-servers.json
# Restart Windsurf to load the MCP server
开发
使用 pip
# Install dependencies
pip install -r requirements.txt
# Run scraper manually
ELASTICSEARCH_URL=http://localhost:9200 python scraper/main.py
# Run MCP server manually
ELASTICSEARCH_URL=http://localhost:9200 python mcp_server/main.py
# Run standalone (Python + Docker Elasticsearch)
python run_standalone.py
# Test the setup
python test_setup.py
使用 uv
# Install dependencies
uv sync
# Run scraper manually
ELASTICSEARCH_URL=http://localhost:9200 uv run python scraper/main.py
# Run MCP server manually
ELASTICSEARCH_URL=http://localhost:9200 uv run python mcp_server/main.py
# Run standalone (Python + Docker Elasticsearch)
uv run python run_standalone.py
# Test the setup
uv run python test_setup.py
集成选项
- Amazon Q Developer - 请参阅
AMAZON_Q_INTEGRATION.md - Windsurf IDE - 请参阅
WINDSURF_INTEGRATION.md - 自定义 MCP 客户端 - 通过 stdio 协议直接使用 MCP 服务
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。