MCP cover image
See in Github
2025-04-02

1

Github Watches

0

Github Forks

3

Github Stars

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")

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • Mintplex-Labs
  • Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.

  • modelcontextprotocol
  • Modellkontext -Protokollserver

  • n8n-io
  • Fair-Code-Workflow-Automatisierungsplattform mit nativen KI-Funktionen. Kombinieren Sie visuelles Gebäude mit benutzerdefiniertem Code, SelbstHost oder Cloud, 400+ Integrationen.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • wong2
  • Eine kuratierte Liste von Servern des Modellkontextprotokolls (MCP)

  • metorial
  • Containerisierte Versionen von Hunderten von MCP -Servern 📡 🧠

  • open-webui
  • Benutzerfreundliche KI-Schnittstelle (unterstützt Ollama, OpenAI-API, ...)

  • langgenius
  • Reviews

    1 (1)
    Avatar
    user_6G0O4MB0
    2025-04-21

    mcp_auto_register by JoshuaSiraj is a fantastic tool! This auto-registration application is easy to use and highly effective. The setup process is straightforward, and the detailed documentation on the GitHub page makes it even easier. I highly recommend it for anyone looking to automate their registration processes. Check it out at https://github.com/JoshuaSiraj/mcp_auto_register.