A minimal Agent Client Protocol (ACP) bridge that wraps mini-swe-agent so it can be run by Zed as an external agent over stdio.
Add an agent_servers entry to Zed’s settings.json. Point command to the Python interpreter that has both agent-client-protocol and mini-swe-agent installed, and args to this example script:
{
"agent_servers": {
"Mini SWE Agent (Python)": {
"command": "/abs/path/to/python",
"args": [
"/abs/path/to/agent-client-protocol-python/examples/mini_swe_agent/agent.py"
],
"env": {
"MINI_SWE_MODEL": "openrouter/openai/gpt-4o-mini",
"MINI_SWE_MODEL_KWARGS": "{\"api_base\":\"https://openrouter.ai/api/v1\"}",
"OPENROUTER_API_KEY": "sk-or-..."
}
}
}
}Notes
- If you install
agent-client-protocolfrom PyPI, you do not need to setPYTHONPATH. - Using OpenRouter:
- Set
MINI_SWE_MODELto a model supported by OpenRouter (e.g.openrouter/openai/gpt-4o-mini,openrouter/anthropic/claude-3.5-sonnet). - Set
MINI_SWE_MODEL_KWARGSto a JSON containingapi_base:{ "api_base": "https://openrouter.ai/api/v1" }. - Set
OPENROUTER_API_KEYto your API key.
- Set
- Alternatively, you can use native OpenAI/Anthropic APIs. Set
MINI_SWE_MODELaccordingly and provide the vendor-specific API key;MINI_SWE_MODEL_KWARGSis optional.
Install mini-swe-agent (or at least its core deps) into the same environment:
pip install agent-client-protocol mini-swe-agent
# or: pip install litellm jinja2 tenacityThen in Zed, open the Agents panel and select "Mini SWE Agent (Python)" to start a thread.
- User prompt handling
- Text blocks are concatenated into a task and passed to mini-swe-agent.
- Streaming updates
- The agent sends
session/updatewithagent_message_chunkfor incremental messages.
- The agent sends
- Command execution visualization
- Each bash execution is reported with a
tool_call(start) and atool_call_update(complete) including command and output (returncodein rawOutput).
- Each bash execution is reported with a
- Final result
- A final
agent_message_chunkis sent at the end of the turn with the submitted output.
- A final
Use Zed’s “open acp logs” command to inspect ACP traffic if needed.