c67 mcp
一个Rust实现 模型上下文协议(MCP) 服务器 背景7 -为AI助手提供访问任何库或框架的最新文档的权限。
概述
这个MCP服务器使像Claude这样的人工智能助手能够从Context7庞大的库和框架数据库中搜索和检索当前文档。Context7提供了不断更新的新鲜、全面的文档,使其成为发展援助的绝佳资源。
主要特点:
- 🔍 库搜索:按库/包名称查找文档
- 📚 文献检索:获取具有可自定义令牌限制的最新文档
- 🎯 主题筛选:关注“安装”、“挂钩”或“布线”等具体方面
- 🦀 防锈性能:快速、内存高效的实施
- 🔒 静态二进制文件:具有rustls的自包含可执行文件(不依赖OpenSSL)
- 🌐 交叉平台的:支持macOS(ARM64/Intel)、Linux和Windows
建筑
这是Rust的替代品 TypeScript Context7 MCP服务器它实现了MCP协议,提供了两个主要工具:
resolve-library-id:搜索库并获取与Context7兼容的IDget-library-docs:获取特定库的文档内容
安装
预构建二进制文件
从以下网址下载适用于您平台的最新版本 发布页面.
使用Nix
# Build from source
nix build github:ck3mp3r/c67-mcp
# Or install to your profile
nix profile install github:ck3mp3r/c67-mcp使用自制咖啡
# Tap the repository
brew tap ck3mp3r/c67-mcp https://github.com/ck3mp3r/c67-mcp
# Install c67-mcp
brew install c67-mcp来源
git clone https://github.com/ck3mp3r/c67-mcp.git
cd c67-mcp
cargo build --release用法
Claude桌面配置
将此添加到您的Claude Desktop MCP设置中(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"context7": {
"command": "/path/to/c67-mcp",
"args": ["--api-key", "your-context7-api-key-here"]
}
}
}对于需要禁用TLS验证的开发或测试环境,请添加 --insecure 标志:
{
"mcpServers": {
"context7": {
"command": "/path/to/c67-mcp",
"args": ["--api-key", "your-context7-api-key-here", "--insecure"]
}
}
}命令行选项
c67-mcp --help选项:
--api-key:Context7 API键(基本用法为可选)--log-level:设置日志记录级别(跟踪、调试、信息、警告、错误)--debug:启用调试日志记录--verbose:增加冗长--insecure:禁用TLS证书验证(对开发/测试有用)
Claude中的示例用法
配置后,您可以询问Claude:
- *“查找React挂钩的最新文档”*
- *“查找Next.js路由的文档”*
- *“获取Tailwind CSS的安装说明”*
Claude将使用MCP服务器搜索Context7并检索当前文档。
API密钥
虽然上下文7可以在没有API键的情况下使用,但有一个键可以提供:
- 更高的利率限制
- 访问高级文档
- 更好的性能
从获取API密钥 背景7.
发展
先决条件
- Rust 1.70+(或使用Nix开发shell)
- \[可选\]Nix用于可重复构建
开发外壳
# Enter development environment with all tools
nix develop
# Or use direnv if you have it set up
echo "use flake" > .envrc && direnv allow建筑
# Development build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run with logging
cargo run -- --debug --api-key your-key-here测试
该项目包括综合测试:
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test file
cargo test --test integration_tests贡献
- 分叉存储库
- 创建要素分支:
git checkout -b feature-name - 进行更改并添加测试
- 运行测试:
cargo test - 运行格式化:
cargo fmt - 运行linting:
cargo clippy - 提交拉取请求
灵感
该项目的灵感来自并遵循以下模式 nu-mcp,另一个Rust MCP服务器实现。
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
相关项目
- Context7 TypeScript MCP -TypeScript官方实现
- 模型上下文协议 -MCP规范
- nu-mcp -Nushell MCP服务器(架构灵感)
