Skip to main content
Glama
Nagendda

MCP Tool Manager

by Nagendda

MCP Tool Manager

프로덕션 환경에 적합하도록 강화된, Model Context Protocol(MCP) 기반의 AI 네이티브 도구 레지스트리 및 에이전트 관리 시스템입니다.

Node.js License: MIT MCP Security


📖 목차

  1. 이 프로젝트는 무엇인가요?

  2. 아키텍처 개요

  3. 프로젝트 구조

  4. 빠른 시작

  5. 구성 참조

  6. API 참조

  7. 구현 계획

  8. 보안 모델

  9. 모니터링 및 관측 가능성

  10. 로드맵

  11. 기여하기


Related MCP server: mcp-tool-gateway

이 프로젝트는 무엇인가요?

MCP Tool Manager는 AI 통합 도구 시스템에서 가장 어려운 운영 문제를 해결하는 듀얼 서버 플랫폼입니다.

문제

해결 방법

LLM이 거대한 API 응답으로 컨텍스트 창을 소진하는 문제

도구별 바이트 예산, 신호를 통한 정상적 잘림 처리

업스트림 API 장애가 LLM까지 전파되는 문제

도구별 서킷 브레이커 (CLOSED → OPEN → HALF-OPEN)

서버 재시작 시 모든 데이터가 손실되는 문제

자동 주기적 디스크 스냅샷, 시작 시 복원

API 게이트웨이에 대한 무차별 대입/인젝션 공격

10개 계열 위협 탐지기 + 계층형 속도 제한 + IP 자동 차단

요청을 end-to-end로 추적할 방법이 없는 문제

X-Trace-ID 헤더를 모든 계층과 업스트림 API에 전파

도구/에이전트가 휘발성 메모리에만 등록되는 문제

파일 영속화된 호출 로그 + 에이전트 JSON 구성 + 상태 스냅샷


아키텍처 개요

┌─────────────────────────────────────────────────────────────────────────┐
│                        MCP Tool Manager Platform                        │
│                                                                         │
│  ┌──────────────────────┐        ┌────────────────────────────────────┐ │
│  │   Manager Server      │        │    Hardened MCP Server             │ │
│  │   src/server          │        │    mcp-server-project              │ │
│  │                       │        │                                    │ │
│  │  • REST API (CRUD)    │        │  • MCP Protocol endpoint           │ │
│  │  • JWT + API key auth │        │  • Agent API key auth + expiry     │ │
│  │  • Tool registry      │        │  • Circuit breaker per tool        │ │
│  │  • Agent management   │        │  • Retry + exponential backoff     │ │
│  │  • Credential vault   │        │  • Response cache (TTL per tool)   │ │
│  │  • Audit log          │        │  • Context window limiting         │ │
│  │  • State snapshots    │        │  • File-persisted call log         │ │
│  │  • WebSocket events   │        │  • 10-family threat detection      │ │
│  │  • Response cache     │        │  • Admin /metrics endpoint         │ │
│  └──────────┬───────────┘        └──────────────┬─────────────────────┘ │
│             │                                    │                       │
│  ┌──────────▼───────────┐        ┌──────────────▼─────────────────────┐ │
│  │   React Dashboard     │        │    Claude Desktop / LLM Agent      │ │
│  │   src/dashboard       │        │    (connects via MCP SDK)          │ │
│  └──────────────────────┘        └────────────────────────────────────┘ │
│                                                                         │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │  Cross-cutting: X-Trace-ID · Rate Limiting · Helmet CSP ·        │   │
│  │  Structured Logging · Connection Limit · Compression             │   │
│  └──────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘

프로젝트 구조

mcp/
├── .env.example                    # Template — copy to .env and fill in values
├── .gitignore                      # Excludes .env, node_modules, logs, snapshots
├── package.json                    # Root scripts — start both servers, CLI, tests
├── README.md                       # This file
├── REPORT.md                       # Full technical capability report
├── CHANGELOG.md                    # Version history
│
├── src/
│   ├── server/                     # Manager Server (REST API)
│   │   ├── index.js                # Entry point — snapshot restore + server start
│   │   ├── app.js                  # Express app — all middleware wired
│   │   ├── routes/
│   │   │   ├── tools.js            # CRUD + test execution for tools
│   │   │   ├── agents.js           # Agent management + tool discovery
│   │   │   ├── auth.js             # Login, register, API key management
│   │   │   ├── credentials.js      # Encrypted credential vault
│   │   │   └── monitoring.js       # Stats, audit log, cache, snapshot status
│   │   ├── middleware/
│   │   │   ├── auth.js             # JWT + API key auth + RBAC
│   │   │   └── error-handler.js    # Typed errors + global handler
│   │   ├── storage/
│   │   │   ├── in-memory-store.js  # All in-memory Maps + operations
│   │   │   ├── seeder.js           # Initial data (skipped if snapshot exists)
│   │   │   └── state-snapshot.js   # Periodic disk snapshots (JSON files)
│   │   ├── utils/
│   │   │   ├── trace.js            # X-Trace-ID middleware
│   │   │   ├── context-limit.js    # Response byte budget + pagination guard
│   │   │   ├── response-cache.js   # node-cache wrapper + TTL presets
│   │   │   ├── encryption.js       # AES-256-CBC for credential vault
│   │   │   └── logger.js           # Levelled logger (error/warn/info/debug)
│   │   └── websocket.js            # Real-time events via WebSocket
│   │
│   ├── dashboard/                  # React + Vite management UI
│   │   ├── src/
│   │   │   ├── pages/              # Dashboard, Tools, Agents, Monitoring, Settings
│   │   │   ├── components/         # Sidebar, Topbar, ToastContainer
│   │   │   ├── services/api.js     # Axios client for Manager Server
│   │   │   └── styles/             # global.css, sidebar.css
│   │   └── vite.config.js
│   │
│   ├── sdk/
│   │   └── index.js                # Developer SDK — npm-publishable client
│   │
│   └── cli/
│       └── index.js                # Admin CLI (17 commands)
│
├── mcp-server-project/             # Hardened MCP Server
│   ├── package.json
│   ├── src/
│   │   ├── server.js               # Boot sequence — all 7 security layers
│   │   ├── mcp-protocol.js         # MCP spec endpoint (/mcp/tools, /mcp/invoke)
│   │   ├── routes/
│   │   │   ├── invoke.js           # Tool invocation (retry + CB + cache + limit)
│   │   │   ├── info.js             # Tool discovery per agent
│   │   │   └── metrics.js          # Admin monitoring endpoint
│   │   ├── middleware/
│   │   │   ├── auth.js             # Agent auth + expiry + scope + disabled check
│   │   │   ├── trace.js            # X-Trace-ID attachment
│   │   │   └── context-limit.js    # Response byte budget
│   │   ├── state/
│   │   │   ├── call-log.js         # Disk-persisted call log (NDJSON)
│   │   │   ├── circuit-breaker.js  # Per-tool CLOSED/OPEN/HALF state machine
│   │   │   └── response-cache.js   # TTL cache with auto-eviction
│   │   ├── loaders/
│   │   │   ├── registry.js         # Central tool+agent in-memory registry
│   │   │   ├── tool-loader.js      # Loads *.json from /tools/
│   │   │   ├── agent-loader.js     # Loads *.json from /agents/
│   │   │   └── credential-loader.js # Merges .env + JSON credentials
│   │   └── watcher.js              # chokidar hot-reload on /tools/ and /agents/
│   ├── security/
│   │   ├── middleware/
│   │   │   ├── security-headers.js # Strict Helmet CSP + CORS
│   │   │   ├── rate-limiter.js     # 3-tier rate limiting + IP auto-block
│   │   │   └── threat-detector.js  # 10-family injection/attack detector
│   │   └── logger/
│   │       └── security-log.js     # Structured security event log (5 levels)
│   ├── tools/                      # Tool definition JSON files
│   ├── agents/                     # Agent definition JSON files
│   ├── credentials/                # .env and JSON secrets (gitignored)
│   ├── logs/                       # Security log + call log (gitignored)
│   └── security-tests/             # Attack simulation suite + benchmark
│
├── snapshots/                      # Manager server state snapshots (gitignored)
└── examples/                       # Example tool/agent JSON files

빠른 시작

사전 요구 사항

요구 사항

버전

Node.js

≥ 16.0.0

npm

≥ 7.0.0

Git

무관

1. 클론

git clone https://github.com/YOUR_USERNAME/mcp-tool-manager.git
cd mcp-tool-manager

2. 의존성 설치

# Root (Manager Server + CLI + SDK)
npm install

# Dashboard
cd src/dashboard && npm install && cd ../..

# MCP Server
cd mcp-server-project && npm install && cd ..

3. 구성

# Manager Server
cp .env.example .env
# Edit .env with your JWT_SECRET, ENCRYPTION_KEY, etc.

# MCP Server
cp mcp-server-project/credentials/.env.example mcp-server-project/credentials/.env
# Edit credentials/.env with your agent keys and tool API keys

4. 실행

# Terminal 1 — Manager Server (port 5000)
npm run dev:server

# Terminal 2 — React Dashboard (port 3000)
npm run dev:dashboard

# Terminal 3 — MCP Server (port 5001 by default)
cd mcp-server-project && npm start

5. 접속

기본 로그인 (Manager)

Email:    admin@mcp-tool-manager.dev
Password: admin123

⚠️ 프로덕션에서는 ADMIN_USERNAME / ADMIN_PASSWORD 환경 변수를 통해 즉시 변경하세요.


구성 참조

Manager 서버 (.env)

# Core
NODE_ENV=development
MCP_SERVER_PORT=5000
MCP_SERVER_HOST=localhost
LOG_LEVEL=info

# Auth
JWT_SECRET=your-super-secret-key-min-32-chars
JWT_EXPIRY=24h
ENCRYPTION_KEY=your-encryption-key-exactly-32-ch

# Context Window
MCP_MAX_RESPONSE_BYTES=65536        # 64 KB default response budget
MCP_MAX_PAGE_SIZE=100               # Max items per paginated endpoint

# Scalability
MCP_MAX_CONNECTIONS=500             # TCP connection limit
SNAPSHOT_DIR=./snapshots            # State persistence directory
SNAPSHOT_INTERVAL_SECS=60           # Save state every 60 seconds
SNAPSHOT_RESTORE=true               # Restore state on startup

# Cache TTLs (seconds)
CACHE_TTL_TOOL_LIST=30
CACHE_TTL_TOOL_ITEM=60
CACHE_TTL_AGENT_LIST=30
CACHE_TTL_STATS=10
CACHE_TTL_ACTIVITY=300

# Future (not yet wired — provide connection string to enable)
DATABASE_URL=postgresql://user:password@localhost:5432/mcp_tools
REDIS_URL=redis://localhost:6379

MCP 서버 (mcp-server-project/credentials/.env)

# Agent API Keys (convention: AGENT_<AGENTID_UPPERCASE>_KEY)
AGENT_MY_AGENT_KEY=your-agent-secret-key

# Tool credentials (referenced by credential_ref in tool JSON)
OPENAI_API_KEY=sk-...
WEATHER_API_KEY=...
SLACK_BOT_TOKEN=xoxb-...

# Admin
ADMIN_KEY=your-admin-key-for-metrics-endpoint

# Server
MCP_PORT=5001
MCP_MAX_CONNECTIONS=200
MCP_MAX_RESPONSE_BYTES=32768        # 32 KB default per tool response

도구 JSON 필드 (MCP 서버)

{
  "name": "my_tool",
  "description": "Human-readable description for the LLM",
  "endpoint_url": "https://api.example.com/endpoint",
  "method": "POST",
  "credential_ref": "MY_API_KEY",
  "parameters": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "Search query" }
    },
    "required": ["query"]
  },
  "cache_ttl_seconds": 60,
  "max_response_bytes": 8192,
  "retry_max": 3,
  "timeout_ms": 10000,
  "circuit_failure_threshold": 5,
  "circuit_open_window_ms": 30000
}

에이전트 JSON 필드 (MCP 서버)

{
  "agent_id": "my-agent",
  "allowed_tools": ["weather_lookup", "send_email"],
  "expires_at": "2027-01-01T00:00:00Z",
  "disabled": false
}

API 참조

Manager 서버 (http://localhost:5000)

인증

메서드

경로

인증

설명

POST

/api/auth/login

JWT 토큰 가져오기

POST

/api/auth/register

계정 생성

GET

/api/auth/me

현재 사용자 + API 키

POST

/api/auth/api-keys

새 API 키 생성

DELETE

/api/auth/api-keys/:key

API 키 해지

도구

메서드

경로

인증

설명

GET

/api/tools

도구 목록 (페이지네이션)

POST

/api/tools

새 도구 등록

GET

/api/tools/:id

도구 상세

PUT

/api/tools/:id

도구 업데이트

DELETE

/api/tools/:id

도구 삭제

POST

/api/tools/:id/test

도구 호출 테스트

에이전트

메서드

경로

인증

설명

GET

/api/agents

에이전트 목록

POST

/api/agents

에이전트 등록

GET

/api/agents/:id

에이전트 상세

PUT

/api/agents/:id

에이전트 업데이트

DELETE

/api/agents/:id

에이전트 삭제

POST

/api/agents/:id/tools

에이전트용 도구 검색

모니터링

메서드

경로

인증

설명

GET

/api/monitoring/health

활성 프로브

GET

/api/monitoring/stats

전체 시스템 통계 + 캐시 + 스냅샷

GET

/api/monitoring/activity

실제 시간별 호출 타임라인 (24시간)

GET

/api/monitoring/top-tools

호출 수 기준 상위 N개 도구

GET

/api/monitoring/audit-log

감사 항목

GET

/api/monitoring/cache

캐시 적중률 + 항목

GET

/api/monitoring/snapshot

마지막 스냅샷 타임스탬프 + 개수

MCP 서버 (http://localhost:5001)

메서드

경로

인증

설명

GET

/health

활성 프로브

GET

/info

AGENT_KEY

호출 에이전트용 도구 목록

GET

/info/all

ADMIN_KEY

모든 도구 + 모든 에이전트

GET

/mcp/tools

Claude Desktop 호환 도구 목록

POST

/mcp/invoke/:tool

MCP 프로토콜 호출

POST

/invoke/:toolName

AGENT_KEY

직접 도구 호출

GET

/metrics

ADMIN_KEY

전체 모니터링 대시보드

GET

/metrics/health

경량 활성 프로브

GET

/metrics/calls

ADMIN_KEY

최근 호출 기록


구현 계획

이 섹션은 전체 로드맵을 문서화합니다 — 구축된 것, 진행 중인 것, 인프라 결정이 필요한 것.

1단계 — 기반 구축 ✅ 완료

  • Manager 서버 REST API (도구, 에이전트, 인증, 자격 증명, 모니터링)

  • 전체 CRUD 연산을 지원하는 인메모리 저장소

  • RBAC을 적용한 JWT + API 키 이중 인증

  • AES-256-CBC 자격 증명 저장소

  • React 대시보드 (도구, 에이전트, 모니터링, 설정 페이지)

  • WebSocket 실시간 이벤트 브로드캐스팅

  • 개발자 SDK (src/sdk/index.js)

  • 17개 명령어를 지원하는 관리자 CLI (src/cli/index.js)

  • MCP 프로토콜 엔드포인트 (Claude Desktop 호환)

  • 파일 기반 도구/에이전트 레지스트리, 핫 리로드 지원 (chokidar)

  • 롤링 링 버퍼 기반 감사 로그

2단계 — 보안 강화 ✅ 완료

  • 10개 계열 위협 탐지기 (SQL/NoSQL/XSS/SSRF/Shell/Template/Path/CMDi/Null/Header 인젝션)

  • 스캐너 user-agent 차단 (sqlmap, nikto, nmap, Burp Suite, 20개 이상 스캐너)

  • 3계층 속도 제한 (전역 + 엄격 + 속도 저하)

  • 무차별 대입 공격 후 IP 자동 차단 (20회 이상)

  • 5단계 심각도 수준의 구조화된 보안 이벤트 로그

  • Helmet 엄격한 CSP (defaultSrc: 'none')

  • 에이전트 키 만료 + 비활성화 플래그

  • 범위(scope) 강제 (requireScope 미들웨어)

  • 인증 실패 + 범위 위반 보안 로깅

  • 보안 테스트 스위트 + 벤치마크 (강화 전/후 비교)

3단계 — 운영 역량 ✅ 완료 (이번 릴리스)

  • X-Trace-ID — 모든 계층과 업스트림 API에 전파되는 고유 요청 상관 ID

  • 서킷 브레이커 — 도구별 CLOSED/OPEN/HALF-OPEN (구성 가능한 임계값)

  • 지수 백오프 재시도 — 200ms → 400ms → 800ms, 4xx 오류는 건너뜀

  • 응답 캐시 — 도구/데이터 유형별 TTL, 적중률 추적, 접두사 무효화

  • 컨텍스트 창 제한 — 도구별 바이트 예산, 신호와 함께 정상적 잘림 처리

  • 페이지네이션 가드 — 전역 ?limit 클램프 (기본 최대 100개 항목)

  • 상태 스냅샷 — 원자적 주기 쓰기, 시작 시 복원 (도구/에이전트/사용자가 재시작 후에도 유지)

  • 연결 수 제한 가드 — 구성 가능한 최대치를 초과하는 TCP 소켓을 끊음

  • 속도 제한 활성화 (Manager) — IP당 분당 전역 300회 + 인증 15회

  • 실제 모니터링 — 실제 호출 데이터 기반 활동 타임라인 (Math.random() 모의 데이터 제거)

  • /metrics 엔드포인트 (MCP) — 전체 관리자 대시보드 (호출, 캐시, 서킷 브레이커, 메모리)

  • node-cache 활성화 (Manager) — 데이터 유형별 TTL 프리셋, 적중률 추적

  • /api/monitoring/cache/api/monitoring/snapshot 신규 엔드포인트

4단계 — 영속성 및 분산 🔲 입력 대기 중

이러한 기능에는 인프라가 필요합니다. pgioredis는 이미 설치되어 있습니다 — 연결 문자열만 있으면 됩니다.

  • PostgreSQLin-memory-store.js를 영구 데이터베이스로 마이그레이션

    • tools, agents, users, api_keys, credentials, audit_log 테이블

    • pg를 통한 연결 풀 (DATABASE_URL은 이미 .env.example에 있음)

  • Redis — 공유 속도 제한 + 세션 + 응답 캐시 저장소

    • 다중 인스턴스 안전성을 위해 node-cache를 ioredis로 교체

    • 모든 서버 인스턴스에 걸친 공유 IP 차단 목록

    • (REDIS_URL은 이미 .env.example에 있음)

  • 수평 확장 — Redis + Postgres가 연결되면 nginx 뒤에 N개 인스턴스 배포

5단계 — 개발자 경험 🔲 선택 사항

  • OpenAPI/Swagger 스펙 자동 생성 (swagger-jsdoc)

  • 시작 시 zod 환경 변수 스키마 검증 (구성 누락 시 fail-fast)

  • JWT 리프레시 토큰 + 블랙리스트

  • Prometheus 메트릭 내보내기 (/metrics/prometheus 엔드포인트)

  • OpenTelemetry 분산 추적

  • 도구 호환성 매트릭스

  • 실시간 서킷 브레이커 상태를 위한 WebSocket 대시보드


보안 모델

Manager 서버

Request
  │
  ├── X-Trace-ID attachment (Layer 0)
  ├── Helmet strict CSP (Layer 1)
  ├── Global rate limit 300/min (Layer 2a)
  ├── Auth rate limit 15/min on /api/auth (Layer 2b)
  ├── Body size limit 2 MB (Layer 3)
  ├── Context window budget (Layer 4)
  ├── Pagination guard max 100 items (Layer 5)
  ├── JWT / API key verification (per-route)
  └── RBAC role check (per-route)

MCP 서버

Request
  │
  ├── X-Trace-ID attachment (Layer 0)
  ├── Strict Helmet CSP (Layer 1)
  ├── IP block list check (Layer 2)
  ├── Body size guard (Layer 3)
  ├── Context window budget (Layer 4)
  ├── HTTP method whitelist (Layer 5)
  ├── Scanner user-agent block (Layer 6)
  ├── Global rate limit + speed slow-down (Layer 7)
  ├── 10-family threat detection (Layer 8)
  ├── Agent API key auth + expiry + disabled check (per-route)
  ├── Tool scope enforcement (per-route)
  ├── Circuit breaker check (per-tool)
  ├── Response cache lookup (per-tool)
  └── Retry + context limit on upstream call (per-tool)

모니터링 및 관측 가능성

사용 가능한 데이터

Source

표시 내용

GET /api/monitoring/stats

시스템 개요, 캐시 통계, 스냅샷 정보, 컨텍스트 제한 구성

GET /api/monitoring/activity

실제 24시간 시간별 호출 타임라인 (성공 + 오류 횟수)

GET /api/monitoring/top-tools

호출 횟수 + 성공률 기준 상위 도구

GET /api/monitoring/audit-log

모든 관리자 작업 (도구 생성/삭제, 에이전트 추가/제거)

GET /api/monitoring/cache

캐시 적중률, 항목 수, 축출 횟수

GET /api/monitoring/snapshot

마지막 스냅샷 타임스탬프 + 레코드 수

GET /metrics (MCP, admin)

서킷 브레이커 상태, 호출 로그, 캐시 통계, 시스템 메모리

GET /metrics/health (MCP, public)

가동 시간 + 메모리 (경량 프로브)

logs/calls.ndjson (MCP)

전체 호출 기록: 트레이스 ID, 에이전트, 도구, 지연 시간, 성공 여부, 재시도 횟수

logs/security.log (MCP)

모든 보안 이벤트: 인증 실패, 위협, 속도 제한, 서킷 트립

snapshots/meta.json (Manager)

마지막 스냅샷: 타임스탬프 + 모든 데이터 유형별 개수

X-Trace-ID 흐름

Client → [generates or passes X-Trace-ID]
  → Manager/MCP Server [attaches to req.traceId, echoes in X-Trace-ID response header]
    → Security log entries [include traceId]
      → Call log entries [include traceId]
        → Upstream API call [X-Trace-ID forwarded in headers]
          → Response [traceId in JSON body]

로드맵

v2.1 (다음)

  • 영구 저장을 위해 PostgreSQL 연결

  • 분산 속도 제한 + 캐시를 위해 Redis 연결

  • 시작 시 zod 환경 변수 스키마 검증

v2.2

  • JWT 리프레시 토큰 + 블랙리스트

  • Prometheus 메트릭 내보내기

  • API 키별 속도 제한 (IP 기반 아님)

v3.0

  • 전체 OpenAPI 스펙

  • OpenTelemetry 분산 추적

  • OAuth2/OIDC 연합 에이전트 ID


기여

브랜치 전략, PR 프로세스 및 코드 스타일 가이드는 CONTRIBUTING.md를 참조하세요.


라이선스

MIT © MCP Tool Manager Team


전체 기술 역량 평가는 REPORT.md를 참조하세요.

A
license - permissive license
Not graded
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 Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A secure tool-execution plane for agentic AI that enforces JWT authentication, rate limiting, prompt-injection inspection, and audit logging, while ingesting downstream OpenAPI endpoints as MCP tools.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to access a unified catalog of tools from various APIs (OpenAPI, GraphQL, MCP, Google Discovery) through the MCP protocol.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to securely call MCP tools with risk scoring, checkpoints, rollback, and approval workflows.
    134
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

  • Free public MCP for AI agents — 193 tools, 44 workflows. No API key.

  • Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.

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/Nagendda/MCP-Tool-Manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server