ask-llm-mcp
Provides tools to make raw text-in/text-out LLM calls using the Codeium (Windsurf) API, with model selection and multi-turn session support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ask-llm-mcp Summarize the contents of README.md in three bullet points."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ask-llm-mcp
Give your coding agent a cheap LLM to delegate to.
ask-llm-mcp is a minimal MCP server that
exposes raw text-in / text-out LLM calls. No agent runtime, no tools, no
context injection — you send a prompt, you get text back.
The point: your main agent (Claude / Codex / CodeBuddy / …) is running on an
expensive model. Summarising a file, classifying an issue, drafting a commit
message, extracting a JSON blob — none of that needs the expensive model.
Hand those subtasks to ask_llm and keep the good model for real reasoning.
Unofficial project. This speaks an undocumented, reverse-engineered API used by the Devin / Windsurf client. It is not affiliated with, endorsed by, or supported by Cognition, Windsurf or Codeium. It requires your own Devin subscription and uses your own credentials. The protocol can change or stop working at any time. Use at your own risk and make sure your usage complies with the terms of service of the service you subscribe to.
Contents
English | 中文文档 | Install guide
Related MCP server: local-llm-mcp
Why
Running devin -p "<prompt>" spawns a full agent runner: it loads a system
prompt, registers tools, and can burn minutes deciding it doesn't want to
answer a one-line question. That's the wrong shape for "classify this log line".
ask-llm-mcp calls the backend GetChatMessage endpoint directly over
Connect-RPC. One HTTP request, one text response. That's it.
The second half of the design is keeping the answer out of your context
window. ask_llm does not return the LLM's text inline — it returns a path.
Your agent reads the file only if it actually needs the content, and can ignore
it, grep it, or pass it along without paying for the tokens twice.
Features
Three tools:
ask_llm,list_models,list_sessions.Model choice with pricing — pick a cheap model per call, or discover options at runtime.
Multi-turn conversations via
session_id.File-based results —
result_file(answer) +log_file(timing, errors, prompt preview) under a configurable data directory.No MCP SDK dependency — hand-rolled JSON-RPC over stdio; the only runtime dependency is
requests.Two stdio transports — newline-delimited JSON and
Content-Lengthframing, auto-detected per message.Offline test suite — protobuf/framing round-trip tests, no credentials needed.
Requirements
Requirement | Notes |
Python | 3.11 or newer (uses |
| Installed automatically by pip / the install script |
| Must be installed and logged in — the server reads its credentials |
A Devin subscription | The API is called with your account |
The server reads your API key from
~/.local/share/devin/credentials.toml (written by devin auth login /
devin login). No key is ever passed through MCP arguments or env vars.
list_models and list_sessions additionally shell out to the devin CLI
(devin models list --format json, devin list --format json). ask_llm
does not.
Quick start
# 1. get the code
git clone https://github.com/agentming/ask-llm-mcp.git
cd ask-llm-mcp
# 2. install (creates an isolated venv + console script)
./install.sh
# 3. sanity check — should print the three tool definitions
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | ask-llm-mcp
# 4. sanity check with real credentials
python3 devin_api.py "Say hello in one sentence."./install.sh --help shows the options (--dev, --uninstall,
--prefix DIR).
Alternative installs
# pipx — no venv management for you
pipx install git+https://github.com/agentming/ask-llm-mcp.git
# plain pip
pip install git+https://github.com/agentming/ask-llm-mcp.git
# run straight from the checkout, no install at all
python3 /path/to/ask-llm-mcp/server.pyThen register it with your MCP client — see below.
Client configuration
Claude Code / Codex CLI
claude mcp add ask-llm -- /absolute/path/to/ask-llm-mcp
# or, without installing:
claude mcp add ask-llm -- python3 /absolute/path/to/ask-llm-mcp/server.pyClaude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or
%APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"ask-llm": {
"command": "/absolute/path/to/ask-llm-mcp",
"env": {
"DEVIN_MODEL": "swe-1-7"
}
}
}
}CodeBuddy Code / other JSON-config clients
.codebuddy/mcp.json or ~/.codebuddy/mcp.json:
{
"mcpServers": {
"ask-llm": {
"command": "python3",
"args": ["/absolute/path/to/ask-llm-mcp/server.py"]
}
}
}More copy-pasteable variants live in examples/.
Use absolute paths. MCP clients launch the server with an arbitrary working directory.
Tools
ask_llm
Raw text-in / text-out LLM call.
Argument | Type | Default | Description |
| string | required | The prompt text to send. |
| string |
| Model uid or alias. Ignored when resuming a session. Use |
| string | — | Resume a multi-turn conversation. Omit to start a new one. |
| string |
| Optional override. |
Returns structured data, not the answer text:
{
"status": "ok",
"session_id": "0f9c...",
"result_file": "/home/you/.local/share/ask-llm/results/20260908_113000_ab12cd34.txt",
"log_file": "/home/you/.local/share/ask-llm/logs/20260908_113000_ab12cd34.json",
"error": null,
"call_id": "20260908_113000_ab12cd34"
}Read result_file for the answer. If the model emitted reasoning, it is
prepended and separated by a --- divider. On failure status is "error",
error carries the message, and result_file contains [ERROR] ….
Multi-turn example — just feed the returned session_id back in:
turn 1: ask_llm(prompt="My function returns None. Here it is: ...")
-> session_id = "0f9c..."
turn 2: ask_llm(prompt="Now show the fix.", session_id="0f9c...")list_models
Lists model families with per-1M-token pricing, context window and cost tier.
Argument | Type | Description |
| string | Case-insensitive filter against family name, uid, label or cost tier (e.g. |
## SWE (aliases: swe)
swe-1-7 — SWE-1.7 [200K ctx, cheap, $0.25/$0.03/$1.00]list_sessions
Lists recent Devin sessions so you can recover a session_id.
Argument | Type | Default | Description |
| integer |
| Max sessions to return. |
| string |
| Filter by working directory; |
Configuration
All configuration is via environment variables (set them in your MCP client's
env block).
Variable | Default | Description |
|
| Default model when |
|
| Seconds to wait for the API response. |
|
| Where |
Result files are never deleted automatically — clear
$ASK_LLM_DATA_DIR/results yourself if it grows.
How it works
MCP client ──stdin (JSON-RPC)──► server.py ──► devin_api.py ──HTTPS──► server.codeium.com
│ (Connect-RPC)
└──► $ASK_LLM_DATA_DIR/{results,logs}/devin_api.pyhand-rolls the protobuf request (GetChatMessageRequest) and wraps it in a single uncompressed Connect-RPC frame. Responses are streamed back as gzipped frames whosedelta_text/delta_thinkingfields are concatenated into the final answer.server.pyimplements just enough of the MCP protocol to advertise and serve the three tools:initialize,tools/list,tools/call. It accepts both newline-delimited JSON andContent-Lengthframing on stdin.
Because the request field numbers were calibrated against live traffic rather than a published schema, they are the most likely thing to break upstream. If calls start failing with an HTTP error, look there first.
Troubleshooting
Symptom | Cause / fix |
|
|
| Same file, missing key — re-login. |
| Expired or revoked key. Re-login with the |
| The request payload was rejected — most often an unsupported |
Empty result file | The model returned no text. Check |
|
|
Tools never appear in the client | Verify the absolute path to |
Server hangs | Raise |
Logs for every call live in $ASK_LLM_DATA_DIR/logs/*.json and include the
timestamp, model, elapsed seconds, prompt length/preview and the error.
Project layout
server.py MCP JSON-RPC server + the three tool implementations
devin_api.py Connect-RPC / protobuf client for the backend (no MCP knowledge)
tests/ Offline tests for the wire helpers
examples/ MCP client config snippets
install.sh Isolated-venv installerContributing
See CONTRIBUTING.md. The short version: keep changes small, never add tests that hit the real API, never commit credentials.
License
MIT © agentming
Available Tools
3 toolsask_llmA
Pure text-in/text-out LLM call. No system prompt, no tools, no context. Use this for cheap LLM calls instead of expensive models. Pass model= to select a specific model (default: swe-1-7). Pass session_id= to resume a multi-turn conversation. Returns structured JSON: session_id, result_file (LLM output), log_file, status. Read the result_file to get the LLM's full text answer.
Inputs: prompt (required), model, session_id, system_prompt.
list_modelsA
List available Devin models with pricing (input/cached/output per 1M tokens), context window, and cost tier. Optionally filter with query=. Use this to discover cheap models before calling ask_llm.
Inputs: query.
list_sessionsA
List recent Devin sessions (id, title, last activity, working directory). Use this to find session_id values for resuming multi-turn conversations.
Inputs: limit, workdir.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: ask_llm executes LLM calls, list_models provides model discovery, and list_sessions handles session lookup. There is no overlap between the action and the two list operations.
All tool names follow a consistent verb_first snake_case pattern: ask_llm, list_models, list_sessions. The naming style is uniform and predictable.
Three tools is well-scoped for this server's purpose. Each tool covers a necessary part of the LLM request workflow: choosing a model, making a call, and resuming sessions.
The core workflow is covered: discover models, call the LLM, and list/resume sessions. Minor gaps exist such as no dedicated session detail or deletion tool, but the main lifecycle is functional.
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for AI dialogue using various LLM models via AceDataCloud
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Generate contextual prompts and reusable agent skills, evaluate prompts with the 16-dimension Prompt Score, and manage saved work in PromptDrive. Twelve MCP tools also provide authorized access to private Memory for source-grounded answers. Connect over Streamable HTTP using OAuth 2.1 and PKCE. Generation consumes account quota and automatically saves successful results; Memory access follows account permissions and plan limits.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI clients to send prompts to a local Codex App Server via MCP, returning text responses and supporting persistent session reuse.-
- AlicenseAqualityFmaintenanceLets MCP clients delegate private or bulk text tasks to a local OpenAI-compatible LLM while keeping data on the machine.11MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to interact with local and cloud-hosted LLM models for model management, text generation, chat, embeddings, and web search/fetch.727 npmAGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to manage local and cloud language models, run text generation and chat, generate embeddings, and perform web search and content fetching.727 npmAGPL 3.0