The Society ElizaOS Connector MCP allows you to integrate ElizaOS agents with Cursor IDE, enabling you to chat with your agents directly from the Cursor interface. This connector acts as a bridge between Cursor and your ElizaOS instance, providing agent listing, selection, and chat functionality.
The simplest way to use this MCP is directly with Cursor using npx:
.cursor/mcp.json
file in your project folder (or the global ~/.cursor/mcp.json
file) and add:{
"mcpServers": {
"society-elizaos-mcp-npx": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"ELIZAOS_SERVER_URL": "http://localhost:3000",
"ELIZAOS_USER_ID": "your-elizaos-user-uuid",
"ELIZAOS_WORLD_ID": "your-elizaos-world-uuid",
"ELIZAOS_AGENT_ID": "your-initial-agent-uuid",
"ELIZAOS_ROOM_ID": "your-initial-agent-uuid",
"ELIZAOS_CONNECTION_TIMEOUT": "120000",
"ELIZAOS_RESPONSE_TIMEOUT": "90000",
"PORT": "3099",
"DEBUG": "true",
"NODE_ENV": "production",
"MCP_DISABLE_PINGS": "true"
}
}
}
}
If you prefer running a local development version:
git clone https://github.com/your-username/society-elizaos-mcp.git
cd society-elizaos-mcp
npm install
npm run build
# Set required environment variables
export ELIZAOS_SERVER_URL="http://localhost:3000"
export ELIZAOS_USER_ID="your-elizaos-user-uuid"
export ELIZAOS_WORLD_ID="your-elizaos-world-uuid"
export ELIZAOS_AGENT_ID="your-initial-agent-uuid"
export ELIZAOS_ROOM_ID="your-initial-agent-uuid"
# Run the server
node dist/index.js
Configure the connector through environment variables in the env
section of your .cursor/mcp.json
file:
Environment Variable | Required | Description |
---|---|---|
ELIZAOS_SERVER_URL |
Yes | URL of your ElizaOS server (e.g., http://localhost:3000 ) |
ELIZAOS_USER_ID |
Yes | Your ElizaOS user UUID |
ELIZAOS_WORLD_ID |
Yes | Your ElizaOS world UUID |
ELIZAOS_AGENT_ID |
No | Initial agent UUID to connect to |
ELIZAOS_ROOM_ID |
No | Must match ELIZAOS_AGENT_ID if provided |
ELIZAOS_CONNECTION_TIMEOUT |
No | Socket connection timeout in ms (default: 120000) |
ELIZAOS_RESPONSE_TIMEOUT |
No | Agent response timeout in ms (default: 90000) |
Once configured, you can use these tools in Cursor:
Check the current connection status and configuration:
{}
Returns:
{
"connectionState": "connected",
"currentAgent": "agent-uuid",
"currentRoom": "room-uuid",
"serverUrl": "http://localhost:3000",
"userId": "user-uuid",
"worldId": "world-uuid",
"connectionTimeout": 120000,
"responseTimeout": 90000
}
Get all available agents from your ElizaOS server:
{}
Returns:
[
{
"id": "agent-uuid-1",
"name": "Agent Name 1"
},
{
"id": "agent-uuid-2",
"name": "Agent Name 2"
}
]
Send a message to the currently selected agent:
{
"message": "Your message to the agent goes here"
}
Returns:
{
"messageText": "Your message to the agent goes here",
"senderId": "your-user-id",
"response": {
"senderId": "agent-id",
"senderName": "Agent Name",
"text": "The agent's response text",
"roomId": "room-id",
"createdAt": 1747632281772,
"source": "mcp_client_chat",
"thought": "Optional agent thought process if available",
"actions": ["REPLY"]
}
}
Switch to a different agent:
{
"agent_id": "the-agent-uuid-to-use",
"room_id": "the-agent-uuid-to-use"
}
Returns:
{
"success": true,
"oldConfig": {
"agentId": "previous-agent-uuid",
"roomId": "previous-room-uuid"
},
"newConfig": {
"agentId": "new-agent-uuid",
"roomId": "new-agent-uuid"
}
}
Missing environment variables: Ensure ELIZAOS_USER_ID
, ELIZAOS_WORLD_ID
, and ELIZAOS_SERVER_URL
are set in your config.
Connection failures: Confirm your ElizaOS server is running at the specified URL.
No agent responses: Check that the agent is active and increase ELIZAOS_RESPONSE_TIMEOUT
if needed.
Agent ID and room ID mismatch: When using set_agent
, ensure both IDs are identical.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.