Liaison: An Autonomous MCP Creator

Inspiration

The inspiration for Liaison struck with the recent release of Anthropic's Model Context Protocol (MCP). The promise of MCP was revolutionary: a standardized framework to connect AI agents seamlessly to any software backend, data source, or API. It proposed a clean separation between the LLM's reasoning and its tools, effectively creating a universal plug for the AI ecosystem.

However, a significant bottleneck remained. Setting up an MCP server still required a developer to manually write the protocol definitions, authentication logic, and integration code for each new tool. This process was the antithesis of the autonomy we expect from intelligent agents.

The vision was an AI agent that could understand a user's intent, autonomously research how a tool's API works, and then generate, validate, and deploy a compliant MCP server to facilitate the connection. This would transform MCP from a developer-friendly protocol into a truly agent-centric one, finally enabling the dream of self-integrating AI.


What it Does

Liaison is an AI agent that acts as an autonomous integration engineer. When a user asks it to perform a task that requires connecting to an unfamiliar software tool (e.g., "Post a summary of my latest Salesforce deals to Slack"), Liaison:

  • Diagnoses the need for connections to Salesforce and Slack. -Researches the APIs for these services. If they are unknown, it scrapes the web for official documentation.
  • Generates compliant MCP server code that defines the necessary tools and resources for each API. -Deploys these servers safely in isolated Docker containers.
  • Connects to them, effectively giving itself the new ability to query Salesforce and post messages to Slack to complete the user's original task.

It uses a hybrid Graph RAG system to remember past integrations, making the process faster each time.


How We Built It

Liaison is built as a modular AI agent with a Python backbone. The architecture consists of:

A Hybrid Knowledge Brain

  • A Graph Database (Neo4j) stores known APIs and their relationship to pre-validated MCP protocols for fast retrieval.
  • For unknown tools, a RAG pipeline using the Brave Search API scrapes the web for documentation.

A Fine-Tuned Protocol Generator

  • A core LLM (fine-tuned Llama 3) is specialized to convert API documentation into valid MCP schemas (resources.json, tools.json) and executable Python server code.

A Safe Execution Sandbox

  • Generated server code is deployed in isolated Docker containers to prevent any security risks to the host system.
  • The main agent connects to these servers via MCP's stdio protocol.

Orchestration Layer

-LangChain manages the overall agent workflow, handling reasoning, tool calls, and memory.


What We Learned

  • Fine-tuning models for structured output tasks like code generation. -Gaining a deep understanding of MCP internals.
  • Architecting a complex AI system that balances autonomy and safety. -Managing knowledge effectively using both graph-based and vector-based retrieval systems.

What's Next for Liaison

  • Expanding the Protocol Library: Adding support for more than just REST APIs, including databases (SQL), cloud services (AWS/Azure CLI), and gRPC. -Improving Validation: Implementing a more robust testing framework with generated unit tests for each new MCP server.
  • Human-in-the-Loop Refinement: Adding features for a user to review, approve, and correct the AI's integration plans before they are deployed, especially for critical systems.
  • Community Knowledge Sharing: Exploring a federated system where instances of Liaison can share successfully generated MCP protocols, creating a crowd-sourced integration network.

Example Task Request

{
  "task": "Post a summary of latest Salesforce deals to Slack",
  "tools": ["Salesforce API", "Slack API"],
  "steps": [
    "Diagnose required tools",
    "Research APIs",
    "Generate MCP server code",
    "Deploy Docker containers",
    "Execute task"
  ]
}

Closing Thought

If MCP is the universal plug, then Liaison is the electrician — autonomously wiring agents to the tools they need.

$$ \text{AI Autonomy} \;\approx\; \text{Reasoning Power} + \text{Self-Integration Ability} $$


Built With

  • chromadb
  • docker
  • langchain
  • lightrag
  • mcp
  • mcpclient
  • n8n
  • python
  • restapi
  • seal
Share this project:

Updates