poe proxy mcp
A FastMCP server that proxies the Poe.com API, allowing users to query various AI models (including Claude 3.7 Sonnet) and share files with models that support it.
A FastMCP server that proxies the Poe.com API, allowing users to query various AI models (including Claude 3.7 Sonnet) and share files with models that support it.
A FastMCP server that proxies the Poe.com API, exposing tools for querying Poe models and sharing files. This server is specifically designed to ensure compatibility with Claude 3.7 Sonnet and other models available through Poe.
Use the provided installation script:
git clone https://github.com/Anansitrading/poe-proxy-mcp.git
cd poe-proxy-mcp
chmod +x install.sh
./install.sh
The script will:
1. Create a virtual environment
2. Install all dependencies
3. Create a .env
file if it doesn't exist
4. Set up the server for both STDIO and SSE transports
If you prefer to set up manually:
Clone this repository:
git clone https://github.com/Anansitrading/poe-proxy-mcp.git
cd poe-proxy-mcp
Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venvScriptsactivate
pip install -r requirements.txt
Create a .env
file with your Poe API key:
cp .env.example .env
# Edit .env with your API key
You can also install the server as a Python package:
pip install -e .
This will make the poe-mcp
and poe-mcp-sse
commands available in your environment.
The server can be configured using environment variables:
Variable | Description | Default |
---|---|---|
POE_API_KEY |
Your Poe API key (required) | None |
DEBUG_MODE |
Enable verbose logging | false |
CLAUDE_COMPATIBLE |
Enable Claude compatibility mode | true |
MAX_FILE_SIZE_MB |
Maximum file size for uploads | 10 |
SESSION_EXPIRY_MINUTES |
Session expiry duration in minutes | 60 |
This is the default mode and is suitable for command-line usage:
# If installed as a package:
poe-mcp
# Or directly:
python poe_server.py
This mode enables the server to be used with web clients:
# If installed as a package:
poe-mcp-sse [port]
# Or directly:
python run_sse_server.py [port]
The server will start on port 8000 by default, or you can specify a different port.
The server exposes the following tools:
ask_poe
Ask a question to a Poe bot.
response = await mcp.call("ask_poe", {
"bot": "claude", # or "o3", "gemini", "perplexity", "gpt"
"prompt": "What is the capital of France?",
"session_id": "optional-session-id", # Optional
"thinking": { # Optional, for Claude models
"thinking_enabled": True,
"thinking_depth": 2
}
})
ask_with_attachment
Ask a question to a Poe bot with a file attachment.
response = await mcp.call("ask_with_attachment", {
"bot": "claude",
"prompt": "Analyze this code",
"attachment_path": "/path/to/file.py",
"session_id": "optional-session-id", # Optional
"thinking": { # Optional, for Claude models
"thinking_enabled": True
}
})
clear_session
Clear a session's conversation history.
response = await mcp.call("clear_session", {
"session_id": "your-session-id"
})
list_available_models
List available Poe models and their capabilities.
response = await mcp.call("list_available_models", {})
get_server_info
Get information about the server configuration.
response = await mcp.call("get_server_info", {})
A simple web client is included in the examples
directory. To use it:
Start the server in SSE mode:
python run_sse_server.py
Open examples/web_client.html
in your browser.
Enter the server URL (default: http://localhost:8000
) and click "Get Available Models".
Select a model, enter your prompt, and click "Submit".
# examples/simple_query.py
import asyncio
from fastmcp import MCPClient
async def main():
client = MCPClient("http://localhost:8000")
response = await client.call("ask_poe", {
"bot": "claude",
"prompt": "Explain quantum computing in simple terms"
})
print(f"Session ID: {response['session_id']}")
print(f"Response: {response['text']}")
if __name__ == "__main__":
asyncio.run(main())
# examples/file_attachment.py
import asyncio
from fastmcp import MCPClient
async def main():
client = MCPClient("http://localhost:8000")
response = await client.call("ask_with_attachment", {
"bot": "claude",
"prompt": "Analyze this code and suggest improvements",
"attachment_path": "examples/simple_query.py"
})
print(f"Session ID: {response['session_id']}")
print(f"Response: {response['text']}")
if __name__ == "__main__":
asyncio.run(main())
This server includes special handling for Claude models, particularly Claude 3.7 Sonnet, which requires specific formatting for the thinking protocol. When using Claude models:
thinking
parameter:
"thinking": {
"thinking_enabled": True,
"thinking_depth": 2, # Optional, default is 1
"thinking_style": "detailed" # Optional
}
To run the test suite:
python run_tests.py
For verbose output:
python run_tests.py --verbose
.env
file.CLAUDE_COMPATIBLE=false
in your .env
file.Enable debug mode by setting DEBUG_MODE=true
in your .env
file for more detailed logs.
This project is licensed under the MIT License - see the LICENSE file for details.