Skip to content

Discussion: MCP Server Integration — query, search, and compose agent teams dynamically #353

@mchawda

Description

@mchawda

Per CONTRIBUTING.md, opening this for community feedback before merging new tooling. Related PR: #352

What this solves

Every integration today (Cursor rules, Aider conventions, Windsurf rules) requires running shell scripts and copying static files. There's no way to programmatically discover, search, or compose agents at runtime.

What I built

An MCP server (integrations/mcp-server/) that turns all 161 agent markdown files into a live, queryable registry. Any MCP-compatible client (Cursor, Claude Code, Claude Desktop) can dynamically interact with the full agent catalog without manual file management.

Tools

Tool What it does
list_agents Browse all 161 agents, optionally filter by division
get_agent Load any agent's full prompt by slug or name
search_agents Find the right specialist by keyword
compose_team Assemble a recommended team for a project objective
list_divisions See all 13 divisions with agent counts

Resources

URI Description
agency://catalog Full agent catalog as JSON
agency://divisions Division summary with counts and names

How it works

  1. Clone the repo
  2. cd integrations/mcp-server && bun install
  3. Add to your MCP client config (e.g. Cursor ~/.cursor/mcp.json):
{
  "mcpServers": {
    "agency-agents": {
      "command": "bun",
      "args": ["run", "/path/to/agency-agents/integrations/mcp-server/src/index.ts"]
    }
  }
}
  1. Ask natural language questions like:
    • "Search for agents that can help with API security"
    • "Compose a team of 5 for building a SaaS MVP"
    • "Get the full prompt for the Security Engineer agent"

Technical details

  • Built with @modelcontextprotocol/sdk v1.28.0 + Zod for typed params
  • Runs on Bun (also works with Node via npx tsx)
  • Parses all agent frontmatter + markdown body at startup (~200ms for 161 agents)
  • Stateless tool calls, structured error handling with isError: true
  • Follows patterns from the MCP Builder agent in this repo

PR

Implementation is in PR #352. Happy to iterate on the approach based on community feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions