Skip to main content
Glama
lamchantuong

modular-mcp

by lamchantuong

modular-mcp

Odooスタイルのアドオン(__manifest__.toml)と、オプションのFastAPI Webレイヤーを備えたモジュール式MCPサーバーです。

セットアップ

python -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"
copy .env.example .env

設定は主に config.toml で行います。環境変数は引き続きFastAPIの設定を上書きできます(.env対応)。

ソース

用途

config.toml

MCPサーバー、ロギング、アドオンのパス、FastAPIのデフォルト

.env / 環境変数

FastAPIのHOST、PORT、LOG_LEVELなどを上書き

Related MCP server: mcp-app

実行

modular-mcp serve
modular-mcp mcp serve
modular-mcp get hello
  • FastAPI UI: http://127.0.0.1:8000/

  • MCPのデフォルト: streamable-http、http://127.0.0.1:5001(config.toml参照)

アドオン

各アドオンは addons/ のフォルダーで、次を含みます。

addons/my_addon/
  __manifest__.toml
  config.toml
  tools.py          # register_tools(mcp, config, logger)

サンプルアドオン: addons/key_value_store/(kv_get / kv_set)

アドオン内の共有インポート:

from app.mcp.utils import format_json, exception_to_error_response
from app.mcp.logging import monitor_performance
from helpers import my_helper  # local module in the same addon folder

dynamic-mcp からツールを移植する

# Before
tools/requests_tools.py

# After
addons/requests/
  __manifest__.toml
  config.toml
  tools.py

ツールのコードを tools.py に移動し、utils.* インポートを app.mcp.utils に変更し、__manifest__.toml で log_key を設定します。

テストとlint

pytest
ruff check .
ruff format --check .
mypy
pyright

Pre-commit

pip install -e ".[dev]"
pre-commit install
pre-commit run --all-files

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables building and running MCP servers over streamable HTTP, exposing tools to AI assistants like Cursor, with examples of mounting multiple servers in FastAPI.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    Framework for building and running MCP servers as HTTP services. Define tools as pure Python functions, wire up with two lines, run with one command.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables managing multiple Odoo instances from a single panel and exposes MCP tools for interacting with them via a unified service.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A modular MCP server built with FastAPI, exposing tools via HTTP endpoints with SSE streaming responses.
    -