Skip to content

Commit 7314503

Browse files
ianhodgewarp-agent
andcommitted
docs: add environment and config usage documentation
Add documentation for the config parameter including: - environment_id for cloud environments - model_id, name, and base_prompt options - MCP server configuration examples Link to Warp docs for environment setup instructions. Co-Authored-By: Warp <agent@warp.dev>
1 parent ebbdf25 commit 7314503

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,67 @@ const response = await client.agent.run({ prompt: 'Fix the bug in auth.go' });
3131
console.log(response.task_id);
3232
```
3333

34+
### Using environments and configuration
35+
36+
You can configure the agent with a custom environment and other settings using the `config` parameter:
37+
38+
<!-- prettier-ignore -->
39+
```ts
40+
import WarpAPI from 'warp-sdk';
41+
42+
const client = new WarpAPI();
43+
44+
const response = await client.agent.run({
45+
prompt: 'Fix the bug in auth.go',
46+
config: {
47+
environment_id: 'your-environment-id', // UID of a cloud environment
48+
model_id: 'claude-sonnet-4', // Optional: specify the LLM model
49+
name: 'bug-fix-config', // Optional: config name for traceability
50+
base_prompt: 'You are a helpful coding assistant.', // Optional: custom base prompt
51+
},
52+
});
53+
54+
console.log(response.task_id);
55+
```
56+
57+
#### Configuration options
58+
59+
The `config` parameter accepts the following fields:
60+
61+
- `environment_id`: UID of a cloud environment to run the agent in. Environments define the Docker image, GitHub repositories, and setup commands for agent execution. See [Creating an Environment](https://docs.warp.dev/integrations/integrations-overview/integrations-and-environments#creating-an-environment) for setup instructions.
62+
- `model_id`: LLM model to use (uses workspace default if not specified)
63+
- `name`: Config name for searchability and traceability
64+
- `base_prompt`: Custom base prompt for the agent
65+
- `mcp_servers`: Map of MCP server configurations by name
66+
67+
#### MCP server configuration
68+
69+
You can configure MCP servers to extend the agent's capabilities:
70+
71+
<!-- prettier-ignore -->
72+
```ts
73+
const response = await client.agent.run({
74+
prompt: 'Check my GitHub issues',
75+
config: {
76+
environment_id: 'your-environment-id',
77+
mcp_servers: {
78+
github: {
79+
warp_id: 'your-shared-mcp-server-id', // Reference a Warp shared MCP server
80+
},
81+
'custom-server': {
82+
command: 'npx',
83+
args: ['-y', '@modelcontextprotocol/server-filesystem'],
84+
env: { PATH: '/usr/local/bin' },
85+
},
86+
'remote-server': {
87+
url: 'https://mcp.example.com/sse',
88+
headers: { Authorization: 'Bearer token' },
89+
},
90+
},
91+
},
92+
});
93+
```
94+
3495
### Request & Response types
3596

3697
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:

0 commit comments

Comments
 (0)