开放数据模型上下文协议
概览
什么是 OpenDataMCP?
OpenDataMCP 是一个创新的平台,旨在通过模型上下文协议将任何开放数据与任何大型语言模型(LLM)连接起来。这使得多样化数据集的无缝集成和利用成为可能,增强了机器学习模型的能力,并促进了更好的数据驱动决策。
OpenDataMCP 的特点
- 多功能数据集成:OpenDataMCP 允许用户将各种类型的开放数据源连接到 LLM,使得利用现有数据集进行高级分析和洞察变得更加容易。
- 模型上下文协议:这一独特的协议确保数据被适当地上下文化,以提高生成输出的相关性和准确性。
- 用户友好的界面:该平台以可用性为设计理念,提供直观的界面,简化数据连接和模型训练的过程。
- 公共存储库:OpenDataMCP 作为公共存储库可用,鼓励全球开发者和数据科学家的合作与贡献。
如何使用 OpenDataMCP
- 访问存储库:访问 OpenDataMCP GitHub 存储库 探索可用的资源和文档。
- 设置您的环境:按照存储库中提供的设置说明配置您的开发环境以使用 OpenDataMCP。
- 连接您的数据:利用模型上下文协议将您的开放数据源与 LLM 连接。文档中提供了详细的指导。
- 训练您的模型:一旦您的数据连接完成,您可以开始使用集成的数据集训练您的 LLM,针对您的特定用例进行优化。
- 合作与分享:通过为存储库做贡献、分享您的发现以及在新功能或改进上进行合作,与社区互动。
常见问题解答
问:可以将哪些类型的开放数据连接到 OpenDataMCP?
答:OpenDataMCP 支持广泛的开放数据格式和来源,包括 CSV、JSON 和来自各种公共数据集的 API。
问:OpenDataMCP 是免费使用的吗?
答:是的,OpenDataMCP 是一个公共存储库,免费使用。用户可以在没有任何订阅费用的情况下访问该平台。
问:我可以为 OpenDataMCP 做贡献吗?
答:当然可以!欢迎贡献。您可以分叉存储库,进行改进,并提交拉取请求与社区分享您的增强功能。
问:使用 OpenDataMCP 的系统要求是什么?
答:系统要求可能会根据您使用的特定 LLM 而有所不同。然而,通常情况下,配备 Python 和必要库的标准开发环境就足够了。
问:我如何保持对 OpenDataMCP 发展的更新?
答:您可以在 GitHub 上关注该存储库并为其加星,以接收有关更新、新功能和社区讨论的通知。
详情
Open Data Model Context Protocol
See it in action
https://github.com/user-attachments/assets/760e1a16-add6-49a1-bf71-dfbb335e893e
We enable 2 things:
- Open Data Access: Access to many public datasets right from your LLM application (starting with Claude, more to come).
- Publishing: Get community help and a distribution network to distribute your Open Data. Get everyone to use it!
How do we do that?
- Access: Setup our MCP servers in your LLM application in 2 clicks via our CLI tool (starting with Claude, see Roadmap for next steps).
- Publish: Use provided templates and guidelines to quickly contribute and publish on Open Data MCP. Make your data easily discoverable!
Usage
<u>Access</u>: Access Open Data using Open Data MCP CLI Tool
Prerequisites
If you want to use Open Data MCP with Claude Desktop app client you need to install the Claude Desktop app.
You will also need uv
to easily run our CLI and MCP servers.
macOS
### you need to install uv through homebrew as using the install shell script
### will install it locally to your user which make it unavailable in the Claude Desktop app context.
brew install uv
Windows
### (UNTESTED)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Open Data MCP - CLI Tool
Overview
### show available commands
uvx odmcp
### show available providers
uvx odmcp list
### show info about a provider
uvx odmcp info $PROVIDER_NAME
### setup a provider's MCP server on your Claude Desktop app
uvx odmcp setup $PROVIDER_NAME
### remove a provider's MCP server from your Claude Desktop app
uvx odmcp remove $PROVIDER_NAME
Example
Quickstart for the Switzerland SBB (train company) provider:
### make sure claude is installed
uvx odmcp setup ch_sbb
Restart Claude and you should see a new hammer icon at the bottom right of the chat.
You can now ask questions to Claude about SBB train network disruption and it will answer based on data collected on data.sbb.ch
.
<u>Publish</u>: Contribute by building and publishing public datasets
Prerequisites
-
Install UV Package Manager
# macOS brew install uv # Windows (PowerShell) powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Linux/WSL curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone & Setup Repository
# Clone the repository git clone https://github.com/OpenDataMCP/OpenDataMCP.git cd OpenDataMCP # Create and activate virtual environment uv venv source .venv/bin/activate # Unix/macOS # or .venv\Scripts\activate # Windows # Install dependencies uv sync
-
Install Pre-commit Hooks
# Install pre-commit hooks for code quality pre-commit install
Publishing Instructions
-
Create a New Provider Module
- Each data source needs its own python module.
- Create a new Python module in
src/odmcp/providers/
. - Use a descriptive name following the pattern:
{country_code}_{organization}.py
(e.g.,ch_sbb.py
). - Start with our template file as your base.
-
Implement Required Components
- Define your Tools & Resources following the template structure
- Each Tool or Resource should have:
- Clear description of its purpose
- Well-defined input/output schemas using Pydantic models
- Proper error handling
- Documentation strings
-
Tool vs Resource
- Choose Tool implementation if your data needs:
- Active querying or computation
- Parameter-based filtering
- Complex transformations
- Choose Resource implementation if your data is:
- Static or rarely changing
- Small enough to be loaded into memory
- Simple file-based content
- Reference documentation or lookup tables
- Reference the MCP documentation for guidance
- Choose Tool implementation if your data needs:
-
Testing
- Add tests in the
tests/
directory - Follow existing test patterns (see other provider tests)
- Required test coverage:
- Basic functionality
- Edge cases
- Error handling
- Add tests in the
-
Validation
- Test your MCP server using our experimental client:
uv run src/odmcp/providers/client.py
- Verify all endpoints respond correctly
- Ensure error messages are helpful
- Check performance with typical query loads
- Test your MCP server using our experimental client:
For other examples, check our existing providers in the src/odmcp/providers/
directory.
Contributing
We have an ambitious roadmap and we want this project to scale with the community. The ultimate goal is to make the millions of datasets publicly available to all LLM applications.
For that we need your help!
Discord
We want to build a helping community around the challenge of bringing open data to LLM's. Join us on discord to start chatting: https://discord.gg/QPFFZWKW
Our Core Guidelines
Because of our target scale we want to keep things simple and pragmatic at first. Tackle issues with the community as they come along.
-
Simplicity and Maintainability
- Minimize abstractions to keep codebase simple and scalable
- Focus on clear, straightforward implementations
- Avoid unnecessary complexity
-
Standardization / Templates
- Follow provided templates and guidelines consistently
- Maintain uniform structure across providers
- Use common patterns for similar functionality
-
Dependencies
- Keep external dependencies to a minimum
- Prioritize single repository/package setup
- Carefully evaluate necessity of new dependencies
-
Code Quality
- Format code using ruff
- Maintain comprehensive test coverage with pytest
- Follow consistent code style
-
Type Safety
- Use Python type hints throughout
- Leverage Pydantic models for API request/response validation
- Ensure type safety in data handling
Tactical Topics (our current priorities)
- Initialize repository with guidelines, testing framework, and contribution workflow
- Implement CI/CD pipeline with automated PyPI releases
- Develop provider template and first reference implementation
- Integrate additional open datasets (actively seeking contributors)
- Establish clear guidelines for choosing between Resources and Tools
- Develop scalable repository architecture for long-term growth
- Expand MCP SDK parameter support (authentication, rate limiting, etc.)
- Implement additional MCP protocol features (prompts, resource templates)
- Add support for alternative transport protocols beyond stdio (SSE)
- Deploy hosted MCP servers for improved accessibility
Roadmap
Let’s build the open source infrastructure that will allow all LLMs to access all Open Data together!
Access:
- Make Open Data available to all LLM applications (beyond Claude)
- Make Open Data data sources searchable in a scalable way
- Make Open Data available through MCP remotely (SSE) with publicly sponsored infrastructure
Publish:
- Build the many Open Data MCP servers to make all the Open Data truly accessible (we need you!).
- On our side we are starting to build MCP servers for Switzerland ~12k open dataset!
- Make it even easier to build Open Data MCP servers
We are very early, and lack of dataset available is currently the bottleneck. Help yourself! Create your Open Data MCP server and get users to use it as well from their LLMs applications. Let’s connect LLMs to the millions of open datasets from governments, public entities, companies and NGOs!
As Anthropic's MCP evolves we will adapt and upgrade Open Data MCP.
Limitations
- All data served by Open Data MCP servers should be Open.
- Please oblige to the data licenses of the data providers.
- Our License must be quoted in commercial applications.
References
- Kudos to Anthropic's open source MCP release enabling initiative like this one.
License
This project is licensed under the MIT License - see the LICENSE file for details
Server配置
{
"mcpServers": {
"open-data-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--opendatamcp--opendatamcp--open-data-mcp",
"odmcp"
],
"env": {}
}
}
}