project-mcp-tools
project-mcp-tools
開発者ツールを、MCP(Model Context Protocol)、REST API、CLI の3つのプロトコルを通じて同時に公開するPythonフレームワークです。すべて単一の共有ツールレジストリから提供されます。
概要
project-mcp-tools は、異なるコンシューマーごとに別々のツールバックエンドを維持するという問題を解決します。@tool() デコレータを使ってツールを一度書くだけで、以下の環境で即座に利用できるようになります:
AIアシスタント — MCPプロトコル経由(FastMCP ベース)
HTTPクライアント — REST API経由(FastAPI + uvicorn ベース)
ターミナルユーザー — CLI経由(argparse ベース)
同梱のツールは、C++開発(コンパイル、静的解析、フォーマット、クラス/テストのスキャフォールディング、インクルードツリー解析)、Pythonフォーマット検証、git操作をカバーしており、すべてサブプロセス実行によるプロセス分離を備えています。
インストール
要件: Python 3.14+、uv パッケージマネージャー
# Clone the repository
git clone <repository-url>
cd project-mcp-tools
# Install dependencies
uv sync使用方法
MCPサーバー
AIアシスタントが接続できるFastMCPサーバーを起動します:
uv run mcp-serverこのサーバーを使用するようにMCPクライアントを設定します。たとえば、ホストプロジェクト(ツールを操作対象にしたいプロジェクト。project-mcp-tools ディレクトリ自体ではありません)のルートにある opencode.json で設定します:
{
"mcp": {
"project-mcp-tools": {
"type": "local",
"command": ["uv", "--directory", "project-mcp-tools", "run", "mcp-server", "--target-project", "../my-host-project"]
}
}
}重要:
--directoryは、uvにproject-mcp-toolsパッケージ(pyproject.toml、依存関係、venv)の場所を指定します。--target-projectは、MCPプロセスとそのすべてのサブプロセスの作業ディレクトリを設定します — これがツールが実際に操作するプロジェクトです。パスはproject-mcp-tools/からの相対パスとして解決されます(uv --directoryが作業ディレクトリを変更するため)。この分離がないと、git/cpp/pythonツールはホストプロジェクトではなくproject-mcp-tools/内で動作してしまいます。
REST APIサーバー
http://0.0.0.0:8000 でFastAPIサーバーを起動します:
uv run api --target-project ../my-host-project各ツールは POST /tools/<tool_name> として公開されます。ツールの関数シグネチャのクエリパラメータは、JSONリクエストボディのフィールドになります。
リクエスト例:
curl -X POST http://localhost:8000/tools/git_quick_upload \
-H "Content-Type: application/json" \
-d '{"message": "my commit"}'Swagger UIは http://localhost:8000/docs で利用できます。
CLI
ターミナルから任意のツールを呼び出します:
uv run cli --target-project ../my-host-project git_quick_upload --message "your commit message"--target-project はツール名より前に指定する必要があります。ホストプロジェクトを参照しないツール(例:get_random_number)は、--target-project なしで呼び出すことができます。
ツールカタログ
一般
Tool | Signature | Description |
|
| 指定されたテキスト説明からGemini(モデル |
|
| 視覚機能を持たないモデルのために、Gemini vision(固定モデル |
|
| 環境のデバッグ情報(cwd、パス、環境変数)を返します |
|
| startとendの間の乱数を返します |
Git
Tool | Signature | Description |
|
| すべての未コミットの変更を破棄し、追跡されていないファイルを削除します。HEADの状態に戻します |
|
| すべてのサブモジュールを最新のリモートコミットに更新します(クリーンなサブモジュールが必要)。ポインタの更新はコミットされずに残されます |
|
|
|
Python
Tool | Signature | Description |
|
| ツールディレクトリ内のすべての |
|
| 現在のディレクトリ配下のすべての |
|
| 指定されたファイルのPythonフォーマット規則を検証します |
C++
Tool | Signature | Description |
|
| すべての |
|
| 指定されたファイルのC++フォーマット規則を検証します |
|
| Clangを使用してC++プロジェクト全体を並列コンパイルします |
|
| 階層文字列(例: |
|
| C++テストファイルをスキャフォールドします |
|
| C++ファイルの再帰的なインクルード依存ツリーを表示します。デフォルトはプロジェクトのメインファイルです |
|
| OpenGL 4.6コアプロファイルの単一ファイルHTMLツリービューである |
セッション
Tool | Signature | Description |
|
| 現在のopencodeチャットセッションがモデルのコンテキストウィンドウをどのくらい使用しているかを報告します( |
プロジェクト構造
project-mcp-tools/
├── main.py # Entry point — builds tool_manager, starts servers
├── pyproject.toml # Project config, dependencies, entry points
├── tools/ # Core engine package
│ ├── __init__.py
│ ├── tool_manager.py # Core orchestrator — shared registry, tool folder loading, subprocess dispatch, CLI/API/MCP exposure
│ ├── tool.py # @tool() decorator, ToolInfo/ParameterInfo models, response contract helpers
│ ├── path_manager.py # Project/target root resolution — injectable, no global state
│ └── folder_scanner.py # Auto-discovers @tool-decorated functions in directories
├── general/ # General-purpose tools (no host project dependency)
│ ├── create_image.py # Gemini image generation tool
│ ├── describe_image.py # Gemini image interpretation tool
│ ├── debug.py # Environment debugging tool
│ └── get_random_number.py # Random number generator
├── sak/
│ ├── common.py # Utilities (process creation, JSON, assertions)
│ └── fso/ # File system objects
├── lib/
│ ├── base_verifier.py # Abstract regex-based code formatter
│ ├── project_config.py # Global project configuration
│ ├── project_file.py # Abstract source file with license header management
│ └── template.py # Jinja-like template engine with imports and lists
├── cpp/
│ ├── analyze.py # C++ full analysis tool
│ ├── code_verifier.py # C++ formatting verification tool
│ ├── compile.py # C++ parallel compilation tool
│ ├── create_class.py # C++ class scaffolding tool
│ ├── create_test.py # C++ test scaffolding tool
│ ├── include_tree.py # C++ include dependency tree tool
│ └── cpp_lib/ # C++ domain library (compiler, model, verifier, build)
├── python/
│ ├── analyze.py # Python full analysis tool
│ ├── code_verifier.py # Python formatting verification tool
│ └── python_lib/ # Python domain library (model, verifier, config)
├── session/
│ ├── context_usage.py # opencode session context usage tool
│ └── session_lib/ # Session domain library (opencode database reader)
├── git/
│ ├── discard_changes.py # Git reset + clean tool
│ └── quick_upload.py # Git pull/add/commit/push tool
├── resources/
│ └── images/ # Generated images (from create_image tool)
├── .agents/
│ └── skills/ # AI assistant skills (compliance audit, uv package manager)
└── docs/
├── templates/ # Template files for class/test scaffolding (user zone)
├── example/ # Usage examples (e.g. google-genai.py) (user zone)
└── agent/ # AI-managed knowledge base (architecture, guides, workflows, status)
├── architecture.md # System architecture and design decisions
├── development/ # Tool development guide
├── style-guide/ # Coding style guides
├── workflow/ # Workflow documentation
└── status.md # Agent task statusアーキテクチャ
システムは、共有ツールレジストリを保持し、3つのトランスポート(CLI、REST API、MCP)すべてを処理する中央の tool_manager オブジェクトを中心に構築されています。
システムアーキテクチャの詳細、設計上の決定、ターゲットプロジェクトの仕組みについては、システムアーキテクチャ ガイドを参照してください。
新しいツールの追加
新しいツールを追加するには、既存のツールフォルダ(または新しいフォルダ)にPythonファイルを作成し、関数を @tool() でデコレートします。
ステップバイステップのチュートリアルと、ツール層およびドメインライブラリの構造に関するガイドラインについては、ツール開発ガイド を参照してください。
設定
グローバル設定とドメイン固有の設定はコードベース内に一元化されています。設定キーと値の完全なリストについては、システムアーキテクチャ - 一元化された設定 を参照してください。
コーディング規約
このプロジェクトのすべてのコードは、すべての識別子での snake_case の排他的使用や特定のスペース規則など、厳格なガイドラインに従う必要があります。完全なガイドラインについては、Pythonスタイルガイド を参照してください。
ライセンス
GNU General Public License v3.0 — 詳細については、ソースファイルのライセンスヘッダーを参照してください。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/maxwellaguiarsilva/project-mcp-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server