Illegal Agents Playground v1 is OUT 🎉 Create an Agent now →
Logo/Docs
Playground/Learn

Learn about MCPs

Learn how to use and create MCPs provided by the Playground, and also play with your own.

What is MCP?

MCP stands for Model Context Protocol. It’s a new and emerging standard for enabling AI Agents to interact with the internet beyond the text box.

Traditionally, LLMs don’t know how to talk to APIs or external services that aren't embedded in their training data. MCPs solve this by offering a structured interface that an AI Agent can understand and use—without needing additional training. You just show it what tools are available.

For more details, visit the official Model Context Protocol site.

This unlocks a powerful plugin paradigm for generative AI Agents—one that’s dynamic, fast to implement, and capable of adapting to the web in real time.


Using pre-configured MCPs

You can use hand-picked MCPs that have been tested by the Illegal Agents team in the Talents section on the right-hand pane.

Select a Prebuilt MCP
  1. Go to the Talents pane inside the Playground.
  1. Open the dropdown and choose from verified MCPs.
  1. Click Add MCP.
Configure Environment Variables
  1. MCPs usually need API tokens to work.
  1. You’ll see a list of required environment variables (e.g., DISCORD_TOKEN).
  1. Paste in your tokens—refer to provider docs or search “[Service name] token”.
  1. For examples, check our setup guides for Telegram and Discord.
Restart the Agent
  1. Click the Restart button if your MCP isn’t initializing.
  1. This reloads the Agent and reconnects all MCPs.

To test a custom MCP hosted locally, enter its URL and click Add URL.


Creating Your Own MCP

If you're building a custom MCP, the best way to start is by looking at a working one.

Install the TypeScript MCP SDK
  1. Clone the repo and explore the examples.
Clone an MCP From the Registry
  1. Find an MCP that matches your use case.
  1. Clone it and run it using SuperGateway (see below).
Run Your MCP with SuperGateway

MCPs use STDIO, which isn’t browser-compatible. SuperGateway converts STDIO output to Server-Sent Events (SSE) so the web interface can read it.

Run this in your terminal:

npx -y supergateway 
--stdio "node path/to/your/MCP/index.js ."
--port 8000 --baseUrl http://localhost:8000
--ssePath /sse --messagePath /message
--cors

This hosts your MCP at http://localhost:8000/sse.

Point Your AI Agent to the MCP
  1. In the Playground, enter the MCP URL (e.g., http://localhost:8000/sse).
  1. If your server runs on a different port/IP, adjust accordingly.
  1. Some MCPs are also hosted publicly—just paste in the URL.

Example for running a file browser MCP using a published package:

npx -y supergateway \ 
  --stdio "npx @modelcontextprotocol/server-filesystem ./" \
  --port 8000 --baseUrl http://localhost:8000 \
  --ssePath /sse --messagePath /message \
  --cors

Adding Bidirectionality to Your MCP

Traditionally, MCPs could only receive commands from the Agent—but they couldn’t send messages back on their own. This is a limitation when building Agents for platforms like Discord or Telegram where incoming events (e.g., messages from users) are important.

We solved this by introducing bi-directional MCPs.

Why it matters

Without bidirectionality:

  • Agents can only act reactively based on what you prompt them with.
  • There’s no way for real-time events (like a new message) to trigger a response.

With bidirectionality:

  • Your MCP can send events back to the Agent, even when no prompt is active.
  • This makes real-time interactions possible (e.g., responding to a Discord message, reacting to a webhook, etc).

How to build a bi-directional MCP

We provide a specialized SDK:
mpc-chat

This SDK powers our Chat Discord MCP, which:

  • Listens for Discord messages.
  • Sends them to the Agent.
  • Lets the Agent reply using MCP actions.

To create your own:

Install the SDK

Clone mpc-chat and review how it handles message queues and SSE responses.

Emit Messages to the Agent

Modify your MCP to send outbound messages via the SDK.

Receive Responses

Let the Agent reply using the MCP action logic you define.

Check out our blog post for more insights into the vision behind this.

How is this guide?

On this page

Facing an issue? Join our Discord, or reach out to us on email.