{"id":29825736,"url":"https://github.com/marios-mamalis/pythonlibrary2mcp","last_synced_at":"2025-10-25T17:48:04.762Z","repository":{"id":304210757,"uuid":"1005159306","full_name":"Marios-Mamalis/pythonlibrary2mcp","owner":"Marios-Mamalis","description":"Quickly expose existing Python library functions as MCP server tools","archived":false,"fork":false,"pushed_at":"2025-07-11T16:55:14.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T18:42:54.179Z","etag":null,"topics":["automation","fastmcp","model-context-protocol","model-context-protocol-servers","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marios-Mamalis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-06-19T19:10:04.000Z","updated_at":"2025-07-11T16:55:18.000Z","dependencies_parsed_at":"2025-07-11T18:42:59.057Z","dependency_job_id":"9ad5be1a-3a34-4c0d-8f9e-cf8a900fdc2a","html_url":"https://github.com/Marios-Mamalis/pythonlibrary2mcp","commit_stats":null,"previous_names":["marios-mamalis/pythonlibrary2mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Marios-Mamalis/pythonlibrary2mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marios-Mamalis%2Fpythonlibrary2mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marios-Mamalis%2Fpythonlibrary2mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marios-Mamalis%2Fpythonlibrary2mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marios-Mamalis%2Fpythonlibrary2mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marios-Mamalis","download_url":"https://codeload.github.com/Marios-Mamalis/pythonlibrary2mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marios-Mamalis%2Fpythonlibrary2mcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267627242,"owners_count":24117716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":["automation","fastmcp","model-context-protocol","model-context-protocol-servers","python-library"],"created_at":"2025-07-29T04:12:29.904Z","updated_at":"2025-10-25T17:47:59.711Z","avatar_url":"https://github.com/Marios-Mamalis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n    \u003ch1\u003e\r\n        PythonLibrary2MCP\r\n    \u003c/h1\u003e\r\n\r\n![Versions](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)\r\n![Tests](https://github.com/Marios-Mamalis/pythonlibrary2mcp/actions/workflows/ci.yml/badge.svg)\r\n![Black](https://img.shields.io/badge/code%20style-black-000000.svg)\r\n\u003c/div\u003e\r\n\r\n\u003cbr\u003e\r\n\r\nThe purpose of this utility is to provide a simple way to quickly port functions of existing Python \r\nlibraries (both built-in and external) as MCP (Model Context Protocol) server tools.\r\n\r\nThe utility is based on the [FastMCP](https://github.com/jlowin/fastmcp) library, and acts as an\r\nadded layer on top.\r\n\r\n\r\n## Installation\r\nTo install the **pylib2mcp** package, simply clone the repository and install it:\r\n```\r\ngit clone https://github.com/Marios-Mamalis/pythonlibrary2mcp\r\ncd pythonlibrary2mcp\r\nuv pip install .\r\n```\r\n`uv` is highly recommended for installation, but `pip` also works.\r\n\r\n\r\n## Usage\r\nThe utility can attach a single function, a list of functions, or be set to automatically \r\ndiscover and attach all compatible routines from a module (except lambda functions) as MCP tools.\r\n\r\nYou can use this package as a regular Python module:\r\n```python\r\nimport pylib2mcp\r\n\r\npylib2mcp.create_pylib_mcp(\r\n    libraries_and_funcs={\r\n        'transliterate': 'translit',  # a single function, external library\r\n        'urllib.parse': ['quote', 'unquote'],  # a list of functions\r\n        'math': None  # all attachable routines in that module\r\n    },\r\n    server_name='Python function server'\r\n).run(\r\n    transport='sse',\r\n    host='0.0.0.0',\r\n    port=8000\r\n)\r\n```\r\nOr run it directly from the command line:\r\n```bash\r\npylib2mcp run --library-functions transliterate:translit \\\r\n              --library-functions urllib.parse:quote,unquote \\\r\n              --library-functions math \\\r\n              --name \"Python function server\"\r\n              --transport sse --host 0.0.0.0 --port 8000\r\n```\r\n\r\n\r\n### Behavior and limitations\r\nThe libraries containing the functions to be attached, must already be installed, if external.\r\n\r\nAutomatic attachment of Python functions as MCP tools is based on their signatures. Signatures with\r\nunsupported I/O types are skipped. However, if a function lacks a signature, it is possible that \r\nit will be attached as an MCP tool but won't function correctly, so it is best to test the attached\r\nfunctions for expected behavior.\r\n\r\n\r\n## Contributing\r\nIf you want to contribute to the project, install the development requirements by syncing the\r\nproject through the lockfile instead of doing a standard install.\r\n\r\nContributions should follow the Black formatting style and pass the test suite.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarios-mamalis%2Fpythonlibrary2mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarios-mamalis%2Fpythonlibrary2mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarios-mamalis%2Fpythonlibrary2mcp/lists"}