Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

Implements Model Context Protocol (MCP) support directly within the Architect Engine, enabling AI agents to interact with Architect capabilities through dynamically generated, plugin-aware tools.

Implementation

MCP as Engine Component (not standalone server)

  • Kotlin/Micronaut implementation integrated into architect-engine/engine/src/main/kotlin/.../mcp/
  • MCP protocol definitions: McpProtocol.kt
  • Dynamic tool service: McpToolService.kt
  • HTTP API controller: McpApiController.kt at /api/mcp
  • Stdio launcher: McpStdioLauncher.kt for Claude Desktop integration

Dynamic & Plugin-Aware Tool Generation

  • Tools are generated dynamically based on registered projects and their tasks
  • Automatically reflects all plugin tasks in real-time
  • Each project gets its own set of tools
  • Each task becomes an executable tool
  • Format: architect_{project}_{task}

Static Tools:

  • architect_list_projects - List all registered projects
  • architect_register_project - Register new projects

Dynamic Tools (per registered project):

  • architect_{project}_list_tasks - List tasks for a specific project
  • architect_{project}_{task} - Execute specific tasks with optional arguments

Example: Project "myapp" with tasks "build" and "test" generates:

  • architect_myapp_list_tasks
  • architect_myapp_build
  • architect_myapp_test

Two Integration Modes:

  1. HTTP API Mode: Available at /api/mcp when engine runs normally
curl -X POST http://localhost:9292/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
  1. Stdio Mode: For Claude Desktop integration
{
  "mcpServers": {
    "architect": {
      "command": "sh",
      "args": [
        "-c",
        "cd /path/to/architect/architect-engine/engine && ./gradlew runMcpStdio"
      ]
    }
  }
}

Benefits

  • No Separate Server: MCP functionality is part of the engine
  • Always Synchronized: Tools reflect current engine state
  • Plugin-Aware: Automatically exposes all plugin tasks
  • Dual-Mode Support: HTTP API + stdio communication

Files Added/Modified

  • architect-engine/engine/src/main/kotlin/.../mcp/protocol/McpProtocol.kt - MCP protocol data classes
  • architect-engine/engine/src/main/kotlin/.../mcp/service/McpToolService.kt - Dynamic tool generation (240 LOC)
  • architect-engine/engine/src/main/kotlin/.../mcp/interfaces/McpApiController.kt - HTTP endpoint
  • architect-engine/engine/src/main/kotlin/.../mcp/McpStdioLauncher.kt - Stdio mode launcher (140 LOC)
  • architect-engine/engine/MCP.md - Comprehensive documentation
  • architect-engine/engine/build.gradle.kts - Added runMcpStdio task
  • Root README.md - Updated with MCP integration details
  • architect-engine/README.md - Added MCP component reference

Custom agent used: archite-coding-agent
coding agent with settings and default for adopted way of working in the architect project

Original prompt

Create an MCP server to integrate architect commands into Agent workflow exposing its capabilities

Custom agent used: archite-coding-agent
coding agent with settings and default for adopted way of working in the architect project


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 15, 2025 11:08
- Create architect-mcp-server with TypeScript implementation
- Add MCP protocol tools for project and task management
- Expose all Architect CLI capabilities to AI agents
- Add comprehensive README and documentation
- Update root README with AI agent integration section

Co-authored-by: alemazzo <28974739+alemazzo@users.noreply.github.com>
Co-authored-by: alemazzo <28974739+alemazzo@users.noreply.github.com>
- Add claude_desktop_config.example.json for easier setup
- Add start script to package.json

Co-authored-by: alemazzo <28974739+alemazzo@users.noreply.github.com>
Copilot AI changed the title [WIP] Add MCP server integration for architect commands feat: add MCP server for Architect CLI integration with AI agents Nov 15, 2025
Copilot AI requested a review from alemazzo November 15, 2025 11:14
@alemazzo
Copy link
Member

@copilot can u write it in kotlin with micronaut? Also the api should be dynamic based on the project on which the mcp is working cause every project have different plugins that enable new tasks

- Add MCP protocol support as a core engine component
- Implement dynamic tool generation based on registered projects and tasks
- Add HTTP API endpoint at /api/mcp for MCP protocol
- Add stdio launcher for Claude Desktop integration
- Tools are plugin-aware and reflect current engine state
- Remove standalone MCP server in favor of engine integration

Co-authored-by: alemazzo <28974739+alemazzo@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot can u write it in kotlin with micronaut? Also the api should be dynamic based on the project on which the mcp is working cause every project have different plugins that enable new tasks

Done! I've rewritten the MCP server in Kotlin with Micronaut and integrated it directly into the Architect Engine as a core component (commit 89eb22e).

Key changes:

  • MCP is now part of the engine, not a separate server
  • Tools are dynamically generated based on registered projects and their tasks
  • Fully plugin-aware - automatically exposes tasks from all active plugins
  • Two modes: HTTP API at /api/mcp and stdio mode via ./gradlew runMcpStdio

Dynamic tool structure:

  • Each registered project gets its own tools
  • Each task in a project becomes an executable tool
  • Example: project "myapp" with tasks "build", "test" creates:
    • architect_myapp_list_tasks
    • architect_myapp_build
    • architect_myapp_test

See architect-engine/engine/MCP.md for full documentation.

Copilot AI changed the title feat: add MCP server for Architect CLI integration with AI agents feat: integrate MCP directly into Architect Engine with dynamic plugin-aware tools Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants