Adding MCP servers
Configuring local and remote MCP servers from Settings or /mcps.
MCP servers extend what the agent can do by adding tools from outside the built-in set, whether that's a local process or a remote service. ML.ai manages them from one form, whether you're adding one that runs on your machine or one you connect to over HTTP.
Open Settings → MCP, or type /mcps.
MCP servers
Connect local or remote tools that ML.ai Code can use while working.
No MCP servers configured.
Local servers
| Field | Description |
|---|---|
| Type | Local |
| Scope | Project or Global |
| Command | The process to launch, e.g. npx -y package-name |
| Advanced: env vars | KEY=value, one per line |
| Advanced: timeouts | Startup timeout and request timeout |
Remote servers
| Field | Description |
|---|---|
| Type | Remote |
| URL | HTTP(S) endpoint |
| Advanced: headers | Request headers sent with every call |
| Advanced: timeout | Request timeout |
| Advanced: OAuth | Optional sign-in, with optional client ID, client secret, and scope |
Never commit secrets into project-scoped MCP config. Reference an environment variable, or use the OAuth sign-in flow instead of pasting a token into a field that lands in the repo.
Example
A local filesystem-adjacent MCP server, scoped to just this project:
Type: Local
Scope: Project
Command: npx -y @some-org/mcp-server-exampleScoping it to Project rather than Global means this server is written to the project's own OpenCode config and only starts for people working in this repo, not in every project you open. npx -y runs the package without a separate install step, fetching it fresh each time the command starts.