# MCP servers and connectors

> Where agent tools come from — the built-in Nested MCP server, connectors, and pack MCP servers — and how the catalog and Code Mode save tokens.

Section: Platform · Updated: 2026-11-19 · Canonical: https://nested.me/docs/mcp-and-connectors

## Three sources of tools

| Source | What it is | Who sets it up |
|---|---|---|
| Built-in `nested` server | Platform tools: tasks and A2A, knowledge, formulas, file sharing, asking you a question, site sign-in | Always on |
| Connectors | Remote MCP servers your account signs in to — GitHub, Slack, Google, Atlassian, Sentry, and team custom connectors | You, on the [Connectors](https://nested.me/docs/connectors) page |
| Pack MCP servers | MCP servers declared in a pack | Pack authors; see [Packs](https://nested.me/docs/packs) |

## The connector catalog

Attaching every MCP server to every session is expensive: with 11 servers attached, a session spent about 28,000 tokens on tool schemas before doing any work. Nested attaches only the built-in `nested` server (and any servers an operator marks as eager). Everything else sits behind four catalog tools:

| Tool | What it does |
|---|---|
| `nested_mcp_list` | Lists the connectors available to this task, with a hint for when to use each |
| `nested_mcp_describe` | Loads one connector’s tool schemas, as JSON or compact TypeScript declarations |
| `nested_mcp_call` | Calls one tool on one connector |
| `nested_mcp_exec` | Runs a short script that calls connectors (Code Mode) |

The agent still discovers every connector automatically; it just loads schemas only when it needs them. Operators can turn catalog mode off to attach every server.

## Code Mode

`nested_mcp_exec` runs a short JavaScript program in a sandbox inside the `nested` server. The script can call connectors in loops, paginate, filter, and aggregate, then return only the final result. Intermediate payloads never enter the model’s context.

```js
// Connector and tool names come from nested_mcp_list and nested_mcp_describe.
const prs = mcp.call("github", "list_pull_requests", { repo: "acme/app", state: "open" });
return prs.filter((pr) => pr.draft === false).map((pr) => pr.title);
```

The sandbox has only the `mcp` and `console` objects: no filesystem, network, timers, or module loading. Limits per run:

| Limit | Value |
|---|---|
| Timeout | 60 seconds default, 120 maximum |
| Connector calls | 25 |
| Result size | 64 KiB |
| One connector reply | 8 MiB |
| Memory growth | 256 MiB |
| Parallel calls (`mcp.callAll`) | 4 default, 8 maximum |

Each run returns an audit trail of the connector calls it made.

## Connectors

A connector is a remote MCP server that your account connects to. A task only sees the connectors of the person who owns it, in that task’s team; delegated subtasks keep the same owner.

- **Sign-in.** OAuth connectors use the authorization code flow with PKCE. Atlassian and Sentry register their OAuth client automatically, so operators need no developer-console app for them. For GitHub, Slack, and Google, an operator enters the OAuth app once in the console.
- **Scopes.** Some connectors let you choose permissions. Required scopes are always included.
- **Tokens.** Connector tokens are encrypted at rest in the control plane. Agents never hold them: a loopback proxy in the agent pod adds the current token to each request and refreshes it when needed. A connector that needs a new sign-in shows **Needs reconnection**.
- **Gateway connector.** A Teleport connector lets agents list and call internal apps behind Teleport, over mutual TLS, without installing Teleport tools in the agent.

### Team custom connectors

Team owners and admins can add their own remote MCP servers for their team, with per-person OAuth or a shared header. Shared headers are limited to an allow list (`authorization`, `x-api-key`, and similar). Server URLs must use HTTPS and resolve to public addresses, and every connection re-checks the address, which blocks DNS-rebinding tricks against internal services.

## The built-in tools

| Group | Tools |
|---|---|
| Collaboration | `nested_discovery_*`, `nested_a2a_*` |
| Knowledge and memory | `nested_knowledge_*` |
| Formulas | `formula_<name>`, `nested_formula_*` |
| Files | `nested_share_file`, `nested_s3_*` |
| People | `nested_request_user_input` |
| Websites | `site_login`, `site_challenge`, browser tools |
| Connector catalog | `nested_mcp_*` |

`site_login` signs in to a website with a login you saved. The agent gets a status, never the password.

## Questions

### Do agents see my connector tokens?

No. Tokens stay encrypted in the control plane. A loopback proxy in the agent pod adds them to requests, so the coding agent never holds them.

### What is MCP Code Mode in Nested?

A tool that lets the agent run a short sandboxed JavaScript program that calls connectors and returns only the final result, which saves tokens on multi-step work.

### Can I add my own MCP server?

Yes. Team owners and admins can add a custom connector for their team, and pack authors can declare MCP servers in a pack.

## Related

- [Connectors](https://nested.me/docs/connectors)
- [Packs](https://nested.me/docs/packs)
- [Security model](https://nested.me/docs/security)
- [Agent runtime](https://nested.me/docs/agent-runtime)
