AI Agent Template MCP Serverのロゴ

AI Agent Template MCP Server

コミュニティ
bswa006

mcp-context-manager

公開者bswa006
リポジトリmcp-context-manager
言語TypeScript
フォーク
1
スター
1
利用可能なツール
4
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    AI Agent Template MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 4個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには1件のスターと1件のフォークがあります。

MCP Context Manager

The definitive MCP (Model Context Protocol) server for perfect AI-assisted development. This server transforms AI agents into expert developers that write flawless, secure, and well-tested code with zero hallucinations.

npm: https://www.npmjs.com/package/mcp-context-manager
GitHub: https://github.com/bswa006/mcp-context-manager

🚀 Overview

This MCP server is the missing piece for AI-assisted development, providing:

  • 🧠 Zero Hallucinations: Context7 integration + multi-layer verification
  • 📈 53% Better Code Quality: Enforced patterns + automated validation
  • 🛡️ Security-First: Real-time vulnerability scanning
  • 🧪 80%+ Test Coverage: Intelligent test generation
  • ⚡ 30% Less Tokens: Efficient context management
  • 🎯 Perfect Pattern Matching: Code indistinguishable from senior developers

🎉 What's New in v2.0.0

Complete UX Enhancement Suite

  • Deep Codebase Analysis: Comprehensive pattern detection and architecture understanding
  • Conversation Starters: Help AI understand your project instantly
  • Token Optimization: 3-tier context system saving 70-95% tokens
  • IDE Integrations: Auto-loading configs for Cursor, VS Code, and IntelliJ
  • Persistence Automation: Git hooks, cron jobs, and monitoring
  • Team Workflows: Onboarding, maintenance, and quality checklists
  • One-Command Setup: Complete workflow from analysis to automation

🌟 Key Features

1. Agent Memory System

  • Persistent Learning: Agents remember patterns, mistakes, and successes
  • Context Awareness: Real-time tracking of current development session
  • Performance Metrics: Continuous improvement through measurement

2. Hallucination Prevention

  • API Verification: Every import and method checked before use
  • Context7 Integration: Real-time documentation for latest APIs
  • Pattern Validation: Ensures code matches existing conventions

3. Intelligent Code Generation

  • Pattern Detection: Analyzes codebase to match style
  • Security Scanning: Catches vulnerabilities before they happen
  • Test Generation: Automatically creates tests for 80%+ coverage

4. Workflow Automation

  • Guided Workflows: Step-by-step guidance for common tasks
  • Proactive Prompts: AI guides itself through best practices
  • Performance Tracking: Metrics for continuous improvement

🚀 Quick Start

Option 1: Use the Published npm Package (Recommended)

bash
# Install globally
npm install -g mcp-context-manager

# Or use directly with npx
npx mcp-context-manager

Then add to your Claude Desktop config:

json
{
  "mcpServers": {
    "context-manager": {
      "command": "npx",
      "args": ["mcp-context-manager"]
    }
  }
}

Note: After updating Claude Desktop config, restart Claude Desktop completely for changes to take effect.

If you still see "0 tools enabled", try this alternative configuration:

json
{
  "mcpServers": {
    "context-manager": {
      "command": "node",
      "args": ["/path/to/global/node_modules/mcp-context-manager/dist/cli.js"]
    }
  }
}

To find the global node_modules path, run: npm root -g

Option 2: Clone and Build Locally

bash
# Clone the repository
git clone https://github.com/bswa006/mcp-context-manager
cd mcp-context-manager

# Install dependencies
npm install

# Build the server
npm run build

Configuration

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "context-manager": {
      "command": "node",
      "args": ["/path/to/ai-agent-template-mcp/dist/server.js"]
    }
  }
}

Cursor

Add to your Cursor settings:

json
{
  "mcp.servers": {
    "context-manager": {
      "command": "node",
      "args": ["/path/to/ai-agent-template-mcp/dist/server.js"]
    }
  }
}

Available Resources (AI Agent Self-Guidance)

Core Resources

  • template://ai-constraints - CRITICAL rules AI must follow when generating code
  • template://current-patterns - REQUIRED patterns to match in new code
  • template://hallucination-prevention - Common AI mistakes and prevention guide
  • template://naming-conventions - MANDATORY naming patterns to follow
  • template://security-requirements - CRITICAL security rules (non-negotiable)
  • template://api-signatures - Valid API methods to prevent hallucinations
  • template://error-handling - REQUIRED error handling patterns

Agent Intelligence Resources

  • template://agent-memory - Persistent memory of patterns and learnings
  • template://agent-context - Real-time context for current session
  • template://pattern-library - Comprehensive code patterns for all scenarios
  • template://workflow-templates - Step-by-step guides for common tasks
  • template://test-patterns - Testing strategies for 80%+ coverage

📚 Complete Tool Reference

Here's a comprehensive list of all 15 tools available in the MCP server:

Core Validation Tools

ToolPurposeKey Features
check_before_suggestingPrevent hallucinationsVerifies imports, methods, and patterns exist before AI suggests code
validate_generated_codeValidate AI outputChecks generated code against project patterns and conventions
get_pattern_for_taskPattern guidanceProvides exact patterns to follow for components, hooks, services, etc.
check_security_complianceSecurity validationScans code for vulnerabilities and security issues
detect_existing_patternsPattern detectionAnalyzes existing codebase to match coding style

Workspace & Project Tools

ToolPurposeKey Features
initialize_agent_workspaceProject setupCreates PROJECT-TEMPLATE.md, CODEBASE-CONTEXT.md, and context files
analyze_codebase_deeplyDeep analysisComprehensive pattern detection, architecture understanding
complete_setup_workflowOne-command setupRuns all setup tools in sequence for complete configuration

Testing & Performance Tools

ToolPurposeKey Features
generate_tests_for_coverageTest generationCreates tests to achieve 80%+ coverage with edge cases
track_agent_performanceMetrics trackingMonitors token usage, validation scores, and improvements

UX Enhancement Tools (v2.0.0)

ToolPurposeKey Features
create_conversation_startersAI context helperQuick tasks, recent work, project overview for faster AI understanding
create_token_optimizerToken savings3-tier context system (minimal/standard/comprehensive) with ROI tracking
create_ide_configsIDE integrationAuto-loading configs for Cursor, VS Code, IntelliJ
setup_persistence_automationAuto-updatesGit hooks, cron jobs, monitoring, validation scripts
create_maintenance_workflowsTeam collaborationOnboarding guides, checklists, metrics dashboards, training materials

Available Tools (AI Self-Validation)

1. check_before_suggesting 🛑

CRITICAL: AI must use this before suggesting any code to prevent hallucinations.

typescript
{
  imports: string[];        // List of imports to verify
  methods: string[];        // List of methods/APIs to verify
  patterns?: string[];      // Code patterns to verify
}

2. validate_generated_code ✅

AI must validate all generated code against project patterns.

typescript
{
  code: string;            // Generated code to validate
  context: string;         // What the code is supposed to do
  targetFile?: string;     // Where this code will be placed
}

3. get_pattern_for_task 📋

Get the exact pattern to follow for a specific task.

typescript
{
  taskType: 'component' | 'hook' | 'service' | 'api' | 'test' | 'error-handling';
  requirements?: string[]; // Specific requirements
}

4. check_security_compliance 🔒

Verify code meets security requirements before suggesting.

typescript
{
  code: string;                    // Code to check
  sensitiveOperations?: string[];  // List of sensitive ops
}

5. detect_existing_patterns 🔍

Analyze existing code to match patterns when generating new code.

typescript
{
  directory: string;       // Directory to analyze
  fileType: string;        // Type of files to analyze
}

6. initialize_agent_workspace 🚀

Initialize complete AI agent workspace with templates and context.

typescript
{
  projectPath: string;     // Path to project
  projectName: string;     // Name of project
  techStack?: {           // Optional tech stack
    language?: string;
    framework?: string;
    uiLibrary?: string;
    testFramework?: string;
  };
}

7. generate_tests_for_coverage 🧪

Generate intelligent tests to achieve 80%+ coverage.

typescript
{
  targetFile: string;              // File to test
  testFramework?: string;          // jest, vitest, mocha
  coverageTarget?: number;         // Default: 80
  includeEdgeCases?: boolean;      // Include edge cases
  includeAccessibility?: boolean;  // Include a11y tests
}

8. track_agent_performance 📊

Track and analyze AI agent performance metrics.

typescript
{
  featureName: string;    // Feature completed
  timestamp: string;      // ISO timestamp
  metrics: {
    tokensUsed: number;
    timeElapsed: number;
    validationScore: number;
    securityScore: number;
    testCoverage: number;
    // ... more metrics
  };
}

9. analyze_codebase_deeply 🔬

Perform comprehensive analysis of codebase to understand patterns and architecture.

typescript
{
  projectPath: string;            // Path to analyze
  maxDepth?: number;             // Max directory depth (default: 5)
  excludePatterns?: string[];    // Patterns to exclude
}

10. create_conversation_starters 💬

Create conversation starters to help AI understand project context quickly.

typescript
{
  projectPath: string;           // Project path
  analysisId?: string;          // Analysis ID from analyze_codebase_deeply
  includeQuickTasks?: boolean;   // Include common quick tasks
  includeCurrentWork?: boolean;  // Include recent git commits
  tokenLimit?: number;          // Maximum tokens for the file
  customTasks?: string[];       // Custom quick tasks to include
}

11. create_token_optimizer 💎

Create tiered context files for token optimization with ROI tracking.

typescript
{
  projectPath: string;           // Project path
  analysisId?: string;          // Analysis ID
  tiers?: ('minimal' | 'standard' | 'comprehensive')[];
  trackUsage?: boolean;         // Enable token usage tracking
  generateMetrics?: boolean;    // Generate ROI metrics report
}

12. create_ide_configs 🛠️

Create IDE-specific configurations for Cursor, VS Code, and IntelliJ.

typescript
{
  projectPath: string;           // Project path
  analysisId?: string;          // Analysis ID
  ide: 'cursor' | 'vscode' | 'intellij' | 'all';
  autoLoadContext?: boolean;     // Enable automatic context loading
  customRules?: string[];       // Custom rules to add
  includeDebugConfigs?: boolean; // Include debugging configurations
}

13. setup_persistence_automation 🔄

Set up automated context updates with monitoring and validation.

typescript
{
  projectPath: string;           // Project path
  analysisId?: string;          // Analysis ID
  updateSchedule: 'daily' | 'weekly' | 'on-change' | 'manual';
  gitHooks?: boolean;           // Install git hooks for validation
  monitoring?: boolean;         // Enable context monitoring
  notifications?: {             // Notification settings
    email?: string;
    slack?: string;
  };
}

14. create_maintenance_workflows 📋

Create team workflows for maintaining AI context quality over time.

typescript
{
  projectPath: string;           // Project path
  analysisId?: string;          // Analysis ID
  teamSize: number;             // Number of developers
  updateFrequency: 'daily' | 'weekly' | 'biweekly' | 'monthly';
  includeChecklists?: boolean;  // Include review checklists
  includeMetrics?: boolean;     // Include metrics dashboard
  includeTraining?: boolean;    // Include training materials
}

15. complete_setup_workflow 🚀

Complete MCP setup workflow: analyze codebase, create all context files, and configure automation.

typescript
{
  projectPath: string;           // Project path
  projectName: string;          // Project name
  teamSize?: number;            // Team size
  updateSchedule?: 'daily' | 'weekly' | 'on-change' | 'manual';
  ide?: 'cursor' | 'vscode' | 'intellij' | 'all';
  includeAll?: boolean;         // Include all optional features
}

Available Prompts (AI Self-Guidance)

1. before_generating_code 🛑

AI MUST use this prompt before generating any code.

2. validate_my_suggestion 🔍

AI should validate its own code before presenting to user.

3. check_patterns 📋

AI checks if it is following project patterns correctly.

4. prevent_hallucination 🧠

AI verifies all imports and methods exist before using them.

5. security_self_check 🔒

AI checks its own code for security issues.

6. workflow_guidance 📋

Get specific workflow guidance based on task context.

7. performance_check 📊

Track agent performance after completing features.

🔄 Workflows

Quick Start with Complete Setup

The fastest way to get started is using the complete_setup_workflow tool:

typescript
// In your AI chat:
Use the complete_setup_workflow tool with these parameters:
{
  "projectPath": "/path/to/your/project",
  "projectName": "My Awesome Project",
  "teamSize": 5,
  "updateSchedule": "weekly",
  "ide": "all"
}

This will:

  1. 📊 Analyze your entire codebase deeply
  2. 📝 Create all context files (PROJECT-TEMPLATE.md, CODEBASE-CONTEXT.md)
  3. 💬 Generate conversation starters for quick AI onboarding
  4. 💎 Create token-optimized context tiers (saving 70-95% tokens)
  5. 🛠️ Generate IDE configs for Cursor, VS Code, and IntelliJ
  6. 🔄 Set up automated updates with git hooks and cron jobs
  7. 📋 Create team workflows and documentation

After completion:

  • Review generated files in agent-context/ directory
  • Commit all files to version control
  • Open in your IDE - context auto-loads!
  • Your AI will now understand your project perfectly

New Feature Development

  1. Initialize workspace with initialize_agent_workspace
  2. Detect patterns with detect_existing_patterns
  3. Verify APIs with check_before_suggesting
  4. Get pattern with get_pattern_for_task
  5. Generate code following patterns
  6. Validate with validate_generated_code
  7. Security check with check_security_compliance
  8. Generate tests with generate_tests_for_coverage
  9. Track metrics with track_agent_performance

Bug Fixing

  1. Analyze error and affected files
  2. Check patterns in affected area
  3. Verify fix approach
  4. Apply minimal changes
  5. Validate and test
  6. Track performance

Code Refactoring

  1. Analyze current implementation
  2. Detect existing patterns
  3. Plan incremental changes
  4. Validate each change
  5. Ensure tests pass
  6. Track improvements

📊 Performance Metrics

The MCP server tracks:

  • Token Usage: Average reduction of 30% vs baseline
  • Code Quality: Validation scores > 80%
  • Security: Zero vulnerabilities in generated code
  • Test Coverage: Consistently achieving 80%+
  • Development Speed: 2-3x faster with fewer iterations

🎯 Best Practices

For AI Agents

  1. Always verify before suggesting: Use check_before_suggesting first
  2. Follow the workflow: Don't skip validation steps
  3. Track everything: Use performance metrics for improvement
  4. Learn from mistakes: Agent memory persists learnings

For Developers

  1. Initialize workspace: Start projects with proper templates
  2. Keep context updated: Maintain CODEBASE-CONTEXT.md
  3. Review agent memory: Check what patterns work best
  4. Monitor metrics: Use performance data to optimize

Development

bash
# Run in development mode
npm run dev

# Type check
npm run type-check

# Lint
npm run lint

# Build for production
npm run build

Architecture

ai-agent-template-mcp/
├── src/
│   ├── server.ts              # Main server entry point
│   ├── resources/             # Resource handlers
│   │   ├── index.ts          # Resource definitions
│   │   └── extractors.ts     # Pattern extractors
│   ├── tools/                # Tool implementations
│   │   ├── validators/       # Hallucination prevention
│   │   ├── analyzers/        # Pattern detection
│   │   ├── patterns/         # Pattern providers
│   │   ├── workspace/        # Workspace initialization
│   │   ├── testing/          # Test generation
│   │   └── performance/      # Metrics tracking
│   └── prompts/              # Workflow guidance
├── AGENT-CODING-TEMPLATE.md  # Master template
├── AGENT-CONTEXT.md          # Session tracking
├── AGENT-MEMORY.md           # Persistent memory
└── .context7.yaml            # API verification

How It Works

When an AI agent with this MCP server generates code:

  1. Pre-Generation Phase:

    • AI loads project constraints and patterns
    • Detects existing patterns in the codebase
    • Verifies all imports and methods exist
    • Gets the correct pattern template
  2. Generation Phase:

    • AI follows the exact patterns from the codebase
    • Applies security requirements automatically
    • Handles all required states (loading/error/empty)
  3. Validation Phase:

    • AI validates its own code (must score > 80%)
    • Checks for security vulnerabilities
    • Ensures pattern compliance
    • Only presents code that passes all checks

🏆 Results

Based on the AI Agent Template methodology:

Code Quality Improvements

  • 53% better test coverage compared to baseline
  • 67% fewer bugs in production
  • 89% reduction in security vulnerabilities
  • Zero hallucinations with verification system

Development Efficiency

  • 30% fewer tokens used per feature
  • 2-3x faster feature completion
  • 60% less time reviewing AI code
  • 45% reduction in back-and-forth iterations

Pattern Compliance

  • 100% pattern match with existing codebase
  • Consistent naming across all generated code
  • Proper error handling in every component
  • Security best practices automatically applied

🔮 Future Enhancements

  • Visual Studio Code extension
  • GitHub Actions integration
  • Multi-language support
  • Team pattern sharing
  • Advanced analytics dashboard
  • Custom pattern training

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit PRs.

📄 License

MIT


インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "context-manager": {
      "command": "npx",
      "args": [
        "mcp-context-manager"
      ]
    }
  }
}

利用可能なツール

  • setup_context

    Create AI context files with smart defaults for your project

  • update_context

    Provides a comprehensive checklist for AI agents to analyze your entire codebase and update context files (AI-CONTEXT.md, AI-PATTERNS.md, CLAUDE.md) with current project state, dependencies, patterns, and structure

  • persist_context

    Enable automatic context loading across AI tools (Cursor, Claude Code, Copilot, etc.)

  • figma_to_code

    Convert Figma designs to production-ready code with AI assistance

AI Agent Template MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度AI Agent Template MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

AI Agent Template MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. AI Agent Template MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "ai-agent-template-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-context-manager"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてAI Agent Template MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. AI Agent Template MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
AI Agent Template MCP Serverを使ってこのタスクを手伝ってもらえますか?
AI Agent Template MCP Server
はい、読みました。
AI Agent Template MCP Serverで調べた結果をお伝えします。

よくある質問

AI Agent Template MCP Server MCPサーバーは何に使いますか?

AI Agent Template MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでAI Agent Template MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでAI Agent Template MCP Serverを利用できます。

TypingMindでAI Agent Template MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。AI Agent Template MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

AI Agent Template MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

AI Agent Template MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでAI Agent Template MCP Server MCPのどのようなツールを利用できますか?

AI Agent Template MCP Serverは4個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

AI Agent Template MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。AI Agent Template MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇