{"id":51011419,"url":"https://github.com/xsa-dev/fastmcp-calculator","last_synced_at":"2026-06-21T03:03:26.057Z","repository":{"id":364825668,"uuid":"1269347984","full_name":"xsa-dev/fastmcp-calculator","owner":"xsa-dev","description":"Terminal calculator with FastMCP server tools","archived":false,"fork":false,"pushed_at":"2026-06-14T16:01:36.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T18:04:24.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xsa-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-14T15:49:52.000Z","updated_at":"2026-06-14T16:01:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xsa-dev/fastmcp-calculator","commit_stats":null,"previous_names":["xsa-dev/fastmcp-calculator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/xsa-dev/fastmcp-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsa-dev%2Ffastmcp-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsa-dev%2Ffastmcp-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsa-dev%2Ffastmcp-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsa-dev%2Ffastmcp-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xsa-dev","download_url":"https://codeload.github.com/xsa-dev/fastmcp-calculator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsa-dev%2Ffastmcp-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34592057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T03:03:25.334Z","updated_at":"2026-06-21T03:03:26.053Z","avatar_url":"https://github.com/xsa-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastMCP Calculator\n\nA small Python calculator that works in two modes:\n\n1. terminal CLI for simple arithmetic operations\n2. FastMCP server exposing the same operations to MCP-compatible agents\n\nThe project is managed with `uv`.\n\n## Requirements\n\n- Python 3.12+\n- uv\n\n## Install dependencies\n\n```bash\nuv sync\n```\n\n## Run tests\n\n```bash\nuv run pytest -q\n```\n\n## CLI usage\n\nRun through the module:\n\n```bash\nuv run python -m calculator.cli add 2 3\nuv run python -m calculator.cli subtract 10 4\nuv run python -m calculator.cli multiply 6 7\nuv run python -m calculator.cli divide 8 2\n```\n\nOr use the installed console script through uv:\n\n```bash\nuv run calculator add 2 3\n```\n\nSuccessful commands print only the result:\n\n```text\n5\n```\n\nDivision by zero exits non-zero and prints an error to stderr:\n\n```bash\nuv run python -m calculator.cli divide 1 0\n```\n\n## MCP server usage\n\nRun the FastMCP server over stdio:\n\n```bash\nuv run python -m calculator.mcp_server\n```\n\nIt exposes these MCP tools:\n\n- `add(a, b)`\n- `subtract(a, b)`\n- `multiply(a, b)`\n- `divide(a, b)`\n\nExample Hermes MCP client registration:\n\n```yaml\nmcp_servers:\n  calculator:\n    command: \"uv\"\n    args:\n      - \"--directory\"\n      - \"/Users/alxy/Desktop/1PROJ/FIRM-A/hsh\"\n      - \"run\"\n      - \"python\"\n      - \"-m\"\n      - \"calculator.mcp_server\"\n```\n\nAfter adding this to a client configuration, restart the client so it discovers the server tools.\n\n## Verification commands\n\n```bash\nuv run pytest -q\nuv run python -m calculator.cli add 2 3\nuv run python -m calculator.cli divide 8 2\nuv run python -m calculator.cli divide 1 0\nuv run python - \u003c\u003c'PY'\nimport asyncio\nfrom calculator.mcp_server import mcp\n\nasync def main():\n    tools = await mcp.list_tools()\n    print(sorted(tool.name for tool in tools))\n\nasyncio.run(main())\nPY\n```\n\nThe division-by-zero command is expected to exit with a non-zero status.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsa-dev%2Ffastmcp-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsa-dev%2Ffastmcp-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsa-dev%2Ffastmcp-calculator/lists"}