Skip to main content

MCP Auto Register

This package automates the registration of functions and classes from a python package into a FastMCP instance.

Installation

To install the package, run the following command:

pip install mcp-auto-register

Usage

Register functions from a package:

from mcp_auto_register.register import register_functions_from_package
from mcp.server.fastmcp import FastMCP

# Initialize MCP instance
mcp_instance = FastMCP()

register_functions_from_package('scipy.linalg', mcp_instance=mcp_instance, func_filter=['eigh', 'inv'])

if __name__ == "__main__":
    mcp_instance.run()

Register classes from a package:

import inspect

from mcp_auto_register.register import register_classes_from_package
from mcp.server.fastmcp import FastMCP

from nba_api.stats.endpoints._base import Endpoint

# Create MCP instance
mcp = FastMCP()

def nba_endpoint_wrapper(endpoint: Endpoint):
    init_params = inspect.signature(endpoint.__init__).parameters
    required_args = {
        p: param.annotation if param.annotation != inspect.Parameter.empty else "Any"
        for p, param in init_params.items()
        if p != "self" and param.default == inspect.Parameter.empty
    }
    def wrapper(**kwargs):
        return endpoint(**kwargs).get_dict()
    
    wrapper.__signature__ = inspect.Signature(
        parameters=[
            inspect.Parameter(arg, inspect.Parameter.POSITIONAL_OR_KEYWORD)
            for arg, _ in required_args.items()
        ]
    )
    return wrapper

register_classes_from_package("nba_api.stats.endpoints", nba_endpoint_wrapper, mcp)

if __name__ == "__main__":
    mcp.run(transport="stdio")

Metadata

Release files for mcp-auto-register 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-auto-register 1.0.2
File Size Uploaded Provenance
mcp_auto_register-1.0.2.tar.gz 35.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-auto-register 1.0.2
File Interpreter ABI Platform
mcp_auto_register-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.7 kB

Release files / mcp_auto_register-1.0.2.tar.gz

Download URL mcp_auto_register-1.0.2.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6cc45e26560e065af7ba3d80cf459f9d7b7bb823f7905a5c2686cf4a0787d7ea
BLAKE2b-256 checksum
How to use checksums
ffb414872023ced8b0dbbedb2705d4560731577bc806b64eaefa69d437c82434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / mcp_auto_register-1.0.2-py3-none-any.whl

Download URL mcp_auto_register-1.0.2-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81533a7e0209209691f0f0fcbd28f7048c36f0900797a587d4a2e84329dc8fe1
BLAKE2b-256 checksum
How to use checksums
b9f730f2320d090fe3976a87f0e0126b6308ec2f71e577e27edafe31275144e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Security for mcp-auto-register 1.0.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page