Skip to main content
Glama

project-mcp-tools

단일 공유 도구 레지스트리에서 MCP(Model Context Protocol), REST API, CLI라는 세 가지 프로토콜을 통해 개발자 도구를 동시에 노출하는 Python 프레임워크입니다.

개요

project-mcp-tools는 서로 다른 소비자를 위해 별도의 도구 백엔드를 유지 관리해야 하는 문제를 해결합니다. @tool() 데코레이터를 사용하여 도구를 한 번 작성하면 다음에서 즉시 사용할 수 있습니다:

  • AI 어시스턴트 — MCP 프로토콜(FastMCP 기반)을 통해

  • HTTP 클라이언트 — REST API(FastAPI + uvicorn 기반)를 통해

  • 터미널 사용자 — CLI(argparse 기반)를 통해

번들로 제공되는 도구는 C++ 개발(컴파일, 정적 분석, 포맷팅, 클래스/테스트 스캐폴딩, include 트리 분석), 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"]
    }
  }
}

중요: --directoryuvproject-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 없이 호출할 수 있습니다.

도구 카탈로그

일반

도구

시그니처

설명

create_image

(description: str, file_name: str | None = None) -> str

주어진 텍스트 설명에서 Gemini(모델 gemini-3.1-flash-lite-image)를 사용하여 이미지를 생성합니다. resources/images/에 저장합니다

describe_image

(image_path: str, description: str) -> str

비전 기능이 없는 모델을 위해 Gemini 비전(고정 모델 gemini-flash-lite-latest)을 사용하여 대상 프로젝트의 이미지를 해석합니다. image_path는 대상 프로젝트를 기준으로 한 상대 경로입니다

debug

() -> str

환경 디버깅 정보(cwd, 경로, 환경 변수)를 반환합니다

get_random_number

(start: int = 1, end: int = 100) -> str

start와 end 사이의 난수를 반환합니다

Git

도구

시그니처

설명

git_discard_changes

() -> str

커밋되지 않은 모든 변경 사항을 버리고 추적되지 않은 파일을 제거합니다. HEAD로 되돌립니다

git_pull_submodules

() -> str

모든 서브모듈을 최신 원격 커밋으로 업데이트합니다(서브모듈이 깨끗해야 함). 포인터 변경은 커밋하지 않은 상태로 둡니다

git_quick_upload

(message: str) -> str

git pull, git add ., git commit -m <message>, git push를 수행합니다

Python

도구

시그니처

설명

python_analyze

() -> str

도구 디렉터리의 모든 *.py 파일에 python_code_verifier를 적용합니다

python_clear

() -> str

현재 디렉터리 아래의 모든 __pycache__ 디렉터리를 제거합니다

python_code_verifier

(files: list[str]) -> str

지정된 파일의 Python 포맷팅 규칙을 검증합니다

C++

도구

시그니처

설명

cpp_analyze

() -> str

모든 .cpp/.hpp 파일에 포맷팅 수정을 적용한 후 cppcheck 정적 분석을 실행합니다

cpp_code_verifier

(files: list[str]) -> str

지정된 파일의 C++ 포맷팅 규칙을 검증합니다

cpp_compile

() -> str

Clang을 사용하여 전체 C++ 프로젝트를 병렬로 컴파일합니다

cpp_create_class

(class_hierarchy: str, include_list: list[str] = [], using_list: list[str] = [], create_header_only: bool = False) -> str

계층 문자열(예: "game/player")에서 새 C++ 클래스를 스캐폴딩합니다

cpp_create_test

(hierarchy: str, flg_adhoc: bool = False, include_list: list[str] = []) -> str

C++ 테스트 파일을 스캐폴딩합니다

cpp_analyze_include_tree

(file_path: str = None) -> str

C++ 파일의 재귀적 include 의존성 트리를 표시합니다. 기본값은 프로젝트 메인 파일입니다

cpp_generate_opengl_html

() -> str

OpenGL 4.6 코어 프로파일의 단일 파일 HTML 트리 뷰인 opengl.htm을 생성합니다. 대상 프로젝트의 include/glad/snake_case.hpp를 읽고, 공식 Khronos refpages를 /tmp/generate-opengl-html로 가져온 다음, 출력을 대상 프로젝트 루트에 씁니다

세션

도구

시그니처

설명

session_context_usage

(session_id: str | None = None, context_limit: int | None = None) -> str

현재 opencode 채팅 세션이 모델 컨텍스트 창을 얼마나 사용 중인지 보고합니다(context_used, context_percent, 모델 한도). opencode 데이터베이스를 직접 읽으며, 대상 프로젝트의 활성 세션을 자동 감지합니다. 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

아키텍처

이 시스템은 공유 도구 레지스트리를 보유하고 세 가지 전송 방식(CLI, REST API, MCP)을 모두 처리하는 중앙 tool_manager 객체를 중심으로 구축되었습니다.

시스템 아키텍처, 설계 결정, 대상 프로젝트 메커니즘에 대한 자세한 설명은 시스템 아키텍처 가이드를 참조하세요.

새 도구 추가

새 도구를 추가하려면 기존 도구 폴더(또는 새 폴더)에 Python 파일을 만들고 함수를 @tool()로 데코레이트하세요.

도구 계층 및 도메인 라이브러리 구성에 대한 단계별 튜토리얼과 지침은 도구 개발 가이드를 참조하세요.

구성

전역 및 도메인별 구성은 코드베이스에 중앙 집중화되어 있습니다. 구성 키와 값의 전체 목록은 시스템 아키텍처 - 중앙 집중식 구성을 참조하세요.

코딩 규칙

이 프로젝트의 모든 코드는 모든 식별자에 snake_case만 사용하고 특정 간격 규칙을 준수하는 등 엄격한 지침을 따라야 합니다. 전체 지침은 Python 스타일 가이드를 참조하세요.

라이선스

GNU General Public License v3.0 — 자세한 내용은 소스 파일의 라이선스 헤더를 참조하세요.

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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.

View all MCP Connectors

Latest Blog Posts

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