开源 foss42 MCP 服务器
概览
一个MCP服务器,揭露了foss42的公用设施——国家数据、文本和案例转换以及方便人的数字和日期格式。 由FastMCP所建,没有API密钥,没有网络调用——一切都以被捆绑的数据在当地运行. 请参看前后的推理和测量. 运行过( 默认值, 如 Claude 代码或 Claude 桌面等本地客户端 ) : 或结束, 对于远程可达到的服务器: MCP的终点是http://:/mcp. 使用绝对路径,并指向venv的翻译而不是赤裸的蟒蛇. 所有5个工具都附加了注释:"只读Hint","idempotentHint","破坏性Hint":"虚假"和"开通WorldHint":"虚假",所以客户端可以跳过确认提示.
概述(AI 翻译)
MCP 服务器显示 foss42公用事业——国家数据、文本和案例转换,以及 方便人类的数字和日期格式。
由快取MCP所建. 5 工作流程形状工具,无 API 键,无 网络调用——一切在本地运行与捆绑的数据相对.
关于推理和前后计量,见DESIGN.md。
- 快开始
- 连接客户端
- 工具 - 工具 - Tools
- 错误
- 发展
快开始
需要 Python 3.10+. (简体中文).
运行于 **stdio **(默认, 本地客户端如克洛德代码或克洛德桌面) :
或超过可流回式HTTP,用于远程可达服务器:
MCP的终点是http:// : /mcp。
| 旗 | 默认 | 描述 | | – – – – – – – – – – – – –
手取工具,见TESTING.md。
□ 连接客户端
** 克劳德法典**
** Claude桌面**——在[T9]中添加:
使用绝对路径, 并指向 venv 的解码器, 而不是空 [ [T10]] 。
所有五个工具都附有说明[[T11]、[T12]、destructiveHint: false和
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
foss42 MCP Server
An MCP server exposing the foss42 utilities — country data, text and case conversion, and human-friendly number and date formatting.
Built with FastMCP. 5 workflow-shaped tools, no API key, no network calls — everything runs locally against bundled data.
See DESIGN.md for the reasoning and measured before/after.
Quick start
Requires Python 3.10+.
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
Run over stdio (the default, for local clients such as Claude Code or Claude Desktop):
.venv/bin/python server.py
Or over streamable HTTP, for a remotely reachable server:
.venv/bin/python server.py --transport http --host 0.0.0.0 --port 8000
The MCP endpoint is then http://:/mcp.
| Flag | Default | Description |
|---|---|---|
--transport |
stdio |
stdio or http |
--host |
127.0.0.1 |
Bind address (http only) |
--port |
8000 |
Bind port (http only) |
To try the tools by hand, see TESTING.md.
Connecting a client
Claude Code
claude mcp add foss42 -- /path/to/mcp/.venv/bin/python /path/to/mcp/server.py
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"foss42": {
"command": "/path/to/mcp/.venv/bin/python",
"args": ["/path/to/mcp/server.py"]
}
}
}
Use absolute paths, and point at the venv’s interpreter rather than a bare python.
All five tools are annotated readOnlyHint, idempotentHint, destructiveHint: false and
openWorldHint: false, so clients can skip confirmation prompts.
Tools
get_country_info
Look up one or more countries and return only the fields you ask for.
get_country_info(country: str | list[str], include: list[CountryField] = None)
country takes a name, alias, or ISO alpha-2/alpha-3 code. You never need to know the
code. Pass a list to look up several at once.
Resolution is forgiving: diacritics, punctuation and the definite article are normalised
(Türkiye, Turkiye, U.S.A., The Netherlands), historical and colloquial names resolve
(Burma → Myanmar, Swaziland → Eswatini, Holland → Netherlands, Great Britain → GB),
and an ambiguous input is reported rather than guessed:
"Korea" → 'Korea' matches more than one country: North Korea (KP), South Korea (KR).
Pass the one you mean, or use search_countries to compare them.
include selects fields; the default is names, codes, flag, stats.
| Field | Contents |
|---|---|
names |
Common name, official name, known aliases |
codes |
ISO 3166-1 alpha-2 and alpha-3 |
flag |
Flag emoji |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"foss42": {
"command": "/path/to/mcp/.venv/bin/python",
"args": ["/path/to/mcp/server.py"]
}
}
}