Turn any Python library or your local script into an LLM Tool in seconds.
allbemcp is a high-performance bridge that instantly exposes any Python environment—whether standard PyPI libraries or your own custom code—as a Model Context Protocol (MCP) server. It enables Large Language Models (Claude, ChatGPT, etc.) to execute local functions, manipulate dataframes, manage stateful objects, and interact with your system safely and efficiently.
Built on the latest FastMCP + StreamableHTTP runtime for maximum compatibility with Claude Desktop, LangChain, and Cursor.
Installation
pip install allbemcp
Usage Scenarios
allbemcp supports two primary use cases: exposing public libraries and exposing your own custom business logic.
1. Exposing Public Libraries
Expose pandas, numpy, or any other installed library to your LLM with a single command. allbemcp handles dependency installation and API generation automatically.
# Install, generate, and serve in one go
allbemcp start pandas
# Explicit transport selection
allbemcp start pandas --transport streamable-http
allbemcp start pandas --transport stdio
2. Exposing Custom Code
allbemcp treats your local Python scripts as first-class citizens. It parses type hints, docstrings, and class structures to generate high-quality tool definitions.
Step 1: Create your script (e.g., my_tools.py)
# my_tools.py
from typing import List
def calculate_bmi(weight_kg: float, height_m: float) -> float:
"""
Calculate Body Mass Index (BMI).
Args:
weight_kg: Weight in kilograms.
height_m: Height in meters.
"""
return round(weight_kg / (height_m ** 2), 2)
class BankAccount:
"""A stateful class example."""
def __init__(self, owner: str):
self.owner = owner
self.balance = 0
def deposit(self, amount: float) -> str:
self.balance += amount
return f"Deposited ${amount}. New balance: ${self.balance}"
# Factory function to create instances
def open_account(owner: str) -> BankAccount:
return BankAccount(owner)
Step 2: Start the server
# allbemcp detects the file in your current directory
allbemcp start my_tools
# FastMCP 3.x is enabled by default in generated requirements
allbemcp generate my_tools --use-fastmcp
The LLM can now call calculate_bmi directly. Furthermore, if the LLM calls open_account, allbemcp automatically manages the returned BankAccount instance, allowing the LLM to make subsequent calls to deposit on that specific object.
Client Configuration
To use your tools with Claude Desktop or other MCP clients, add the corresponding configuration to your claude_desktop_config.json.
For a Library (e.g., pandas):
{
"mcpServers": {
"pandas": {
"command": "uv",
"args": ["run", "allbemcp", "start", "pandas"]
}
}
}
For Custom Code (e.g., my_tools):
{
"mcpServers": {
"my_tools": {
"command": "uv",
"args": ["run", "allbemcp", "start", "my_tools"],
"cwd": "/absolute/path/to/your/script/directory"
}
}
}
Key Features
Zero-Config Introspection
Automatically inspects Python packages or local modules, extracts public APIs, and generates a fully compliant MCP server. No manual schema definition (YAML/JSON) is required.
Stateful Object Management
Unlike standard stateless tools, allbemcp supports object-oriented workflows:
- Instance Persistence: When a function returns a class instance, it is stored in memory.
- Method Chaining: LLMs can invoke methods on specific stored instances via a generated
object_id. - Ideal For: Database connections, game states, simulation environments, and session-based workflows.
Smart Serialization Engine
LLMs struggle with complex objects. allbemcp handles them automatically:
- DataFrames: Converted to markdown or JSON previews based on size.
- Images: Automatically encoded or saved to temporary storage with resource links.
- Iterators: Automatically consumed and summarized.
Local & Secure
Runs entirely on your machine. No data leaves your network. You control the host binding (default 127.0.0.1) and execution environment.
Advanced Usage
Inspect a Library
Check which functions will be exposed and view their quality scores before generating code:
allbemcp inspect numpy
Generate Only
Generate the server code without running it (useful for auditing or customization):
allbemcp generate matplotlib --output-dir ./my-server
License
This project is licensed under the AGPL v3 License.
Metadata
Release files for allbemcp 2.2.0
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 | |
|---|---|---|---|---|
| allbemcp-2.2.0.tar.gz | 72.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| allbemcp-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 142.4 kB
Release files / allbemcp-2.2.0.tar.gz
| Download URL | allbemcp-2.2.0.tar.gz |
|---|---|
| Size | 72.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1656c94d49d9a16db56c1d98986ca314d87ccd73f4ae2bd9541aa3d296f35060
|
|
BLAKE2b-256 checksum How to use checksums |
93d12d2297ded71889baa3e78988216d592f35bdbe56dd4d11fcbacd7ed75032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.
Transparency logRelease files / allbemcp-2.2.0-py3-none-any.whl
| Download URL | allbemcp-2.2.0-py3-none-any.whl |
|---|---|
| Size | 70.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac15d0dd9fcd813af5b799ff457943f0c2e3dc0a37c52e0a63e2e4c26e73b12c
|
|
BLAKE2b-256 checksum How to use checksums |
f169e1fbcde70c3320c975f43721923f36591ed41a4b7b6db813f04dddb72655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.
Transparency logSecurity for allbemcp 2.2.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for allbemcp-2.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.
Transparency logA 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.