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.
- Go to the Talents pane inside the Playground.
- Open the dropdown and choose from verified MCPs.
- Click
Add MCP.
- MCPs usually need API tokens to work.
- You’ll see a list of required environment variables (e.g.,
DISCORD_TOKEN).
- Paste in your tokens—refer to provider docs or search “[Service name] token”.
- Click the
Restartbutton if your MCP isn’t initializing.
- 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.
- Follow the docs at modelcontextprotocol/typescript-sdk.
- Clone the repo and explore the examples.
- Visit the Illegal Agents MCP Registry.
- Find an MCP that matches your use case.
- Clone it and run it using SuperGateway (see below).
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
--corsThis hosts your MCP at http://localhost:8000/sse.
- In the Playground, enter the MCP URL (e.g.,
http://localhost:8000/sse).
- If your server runs on a different port/IP, adjust accordingly.
- Some MCPs are also hosted publicly—just paste in the URL.
Example for running a file browser MCP using a published package:
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:
Clone mpc-chat and review how it handles message queues and SSE responses.
Modify your MCP to send outbound messages via the SDK.
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?