This directory contains examples using the ACP library for TypeScript:
agent.ts- A minimal agent implementation that simulates LLM interactionclient.ts- A minimal client implementation that spawns theagent.tsas a subprocess
While minimal, agent.ts implements a compliant ACP Agent. This means we can connect to it from an ACP client like Zed!
- Clone this repo
$ git clone https://github.com/agentclientprotocol/typescript-sdk.git- Add the following at the root of your Zed settings:
"agent_servers": {
"Example Agent": {
"command": "npx",
"args": [
"tsx",
"/path/to/agent-client-protocol/src/examples/agent.ts"
]
}❕ Make sure to replace /path/to/agent-client-protocol with the path to your clone of this repository.
Note: This configuration assumes you have npx in your PATH.
-
Run the
acp: open acp logsaction from the command palette (⌘⇧P on macOS, ctrl-shift-p on Windows/Linux) to see the messages exchanged between the example agent and Zed. -
Then open the Agent Panel, and click "New Example Agent Thread" from the
+menu on the top-right.
- Finally, send a message and see the Agent respond!
You can also run the Agent directly and send messages to it:
npx tsx src/examples/agent.tsPaste this into your terminal and press enter:
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1}}You should see it respond with something like:
{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,"agentCapabilities":{"loadSession":false}}}From there, you can try making a new session and sending a prompt.
Run the client example from the root directory:
npx tsx src/examples/client.tsThis client will spawn the example agent as a subprocess, send a message, and print the content it receives from it.

