Chromium Source MCP Server
这是一个 Model Context Protocol (MCP) 服务器,专门用于获取 Chromium 源代码。由于直接访问 Chromium 源码网站(如 source.chromium.org)无法获取代码内容,此服务器提供了一个解决方案。
功能
get_chromium_file(file_path, branch): 通过文件路径和分支获取 Chromium 源代码文件get_chromium_file_from_url(url): 通过 source.chromium.org URL 获取 Chromium 源代码文件search_chromium_files(pattern, branch): 搜索匹配模式的文件(占位功能)
使用方法
启动服务器
python main.py
或直接运行:
python source_fetch.py
与 MCP 客户端集成
在您的 MCP 客户端配置中添加服务器:
{
"mcpServers": {
"chromium-source": {
"command": "python",
"args": ["-m", "source_fetch"]
}
}
}
运行测试
测试文件位于 test/ 目录中(包含 init.py 使其成为 Python 包):
# 运行核心功能测试
python -m test.test_core
# 或直接运行测试文件
python test/test_core.py
工具说明
get_chromium_file
- 参数:
file_path(str),branch(str, 默认 "main") - 示例: 获取
chrome/app/chrome_main.cc文件 - 返回: 文件内容或错误信息
get_chromium_file_from_url
- 参数:
url(str) - source.chromium.org URL - 示例:
https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/chrome_main.cc - 返回: 文件内容或错误信息
search_chromium_files
- 参数:
pattern(str),branch(str, 默认 "main") - 说明: 目前为占位功能,需要实现完整的搜索逻辑
技术细节
- 使用 FastMCP 框架创建 MCP 服务器
- 通过
https://chromium.googlesource.com/API 获取原始文件内容 - 支持 base64 解码(Chromium 返回的内容通常被编码)
- URL 解析支持多种格式(如
main、refs/heads/main等)
Metadata
Release files for chromium-mcp-server 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chromium_mcp_server-0.1.1.tar.gz | 5.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chromium_mcp_server-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / chromium_mcp_server-0.1.1.tar.gz
| Download URL | chromium_mcp_server-0.1.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8152ba9feb06453331d50f15464556c0fa93b79c9f9198a0c2c918d431d319c
|
|
BLAKE2b-256 checksum How to use checksums |
92cb84d08fa9c8171bed0de64d6406baf26727b58512b0c730d81b45c036d627
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / chromium_mcp_server-0.1.1-py3-none-any.whl
| Download URL | chromium_mcp_server-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52f928e6536396e5f818664141d3ce456ef0718d3da03a3c0e6e70bcd8c2d6fe
|
|
BLAKE2b-256 checksum How to use checksums |
67dac9b24aef0e5a17cf9860775384bbb8699577da251cdb16f6f513a53ddd0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for chromium-mcp-server 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.