# MCP and connecting an agent > Connect any agent to your port by signing in, in one command, and see the tools it gets and what their answers look like. Source: https://docs.getport.app/api/mcp/ The MCP endpoint is `https://getport.app/mcp`. You connect by signing in: the first time an agent or an app asks, it sends you to getport.app, you sign in and press Allow, and it is connected. No key. A key still works, for anything that cannot sign in; it is at the end. Works with - [Claude](https://docs.getport.app/api/mcp/#connect) - [ChatGPT](https://docs.getport.app/api/mcp/#connect) - [Claude Code](https://docs.getport.app/api/mcp/#connect) - [Codex](https://docs.getport.app/api/mcp/#connect) - [Cursor](https://docs.getport.app/api/mcp/#connect) - [VS Code](https://docs.getport.app/api/mcp/#connect) - [GitHub Copilot](https://docs.getport.app/api/mcp/#connect) - [Windsurf](https://docs.getport.app/api/mcp/#connect) ## Connect - [Every coding agent](#tab-panel-0-0) - [claude.ai and ChatGPT](#tab-panel-0-1) - [Claude Code](#tab-panel-0-2) - [Codex](#tab-panel-0-3) - [Cursor](#tab-panel-0-4) - [VS Code](#tab-panel-0-5) One command finds the coding agents on your computer and adds Port\_ to the ones you pick: ```sh npx add-mcp@2.4.0 https://getport.app/mcp --name port -g ``` The first time one of them needs your port, your browser opens to sign in. In claude.ai, Claude Desktop or ChatGPT, add a custom connector with this address: ```sh https://getport.app/mcp ``` It sends you to getport.app. Sign in if you are not already, read what the app will be able to see, and press Allow. You land back in the app, connected. In ChatGPT, custom connectors need developer mode, under Settings, Apps & Connectors, Advanced. ```sh claude mcp add --transport http --scope user port https://getport.app/mcp ``` Then type `/mcp` in Claude Code, pick `port` and choose Authenticate. ```sh codex mcp add port --url https://getport.app/mcp ``` If it does not open the browser by itself, run `codex mcp login port`. Add to Cursor’s `mcp.json`, and it signs you in when it first connects: ```sh { "mcpServers": { "port": { "url": "https://getport.app/mcp" } }} ``` Add to VS Code’s `mcp.json`, and it signs you in when it first connects: ```sh { "servers": { "port": { "type": "http", "url": "https://getport.app/mcp" } }} ``` ### What an app gets when you sign in - **Your own port, read only**, the same as a key: every tool below except refresh, which you can tick on the Allow page if you want the app to ask for a fresh read of your wallets. - **Nothing else.** It cannot move funds, sign anything, add a wallet or change a setting, and it never sees your password or your session. - **You see it and can end it.** It is listed under Settings, API access, with a Disconnect button that stops it on its next call. We email you whenever an app is connected, and resetting your password disconnects every app along with every key. The [plugin](https://docs.getport.app/api/plugin/) adds the server and the skills to Claude Code or Codex in one install. ### With a key instead For a client that cannot sign in, make a key under Settings, API access, keep it in `PORT_API_KEY`, and give it the block for your client. None of them has the key typed in. - [Claude Code](#tab-panel-1-0) - [Codex](#tab-panel-1-1) - [Cursor](#tab-panel-1-2) - [VS Code](#tab-panel-1-3) ```sh claude mcp add --transport http --scope user port https://getport.app/mcp --header "Authorization: Bearer $PORT_API_KEY" ``` Your shell fills in `$PORT_API_KEY` when the command runs, so Claude Code saves the key in its own settings. After you revoke or replace the key, run it again. ```sh [mcp_servers.port]url = "https://getport.app/mcp"bearer_token_env_var = "PORT_API_KEY" ``` ```sh { "mcpServers": { "port": { "url": "https://getport.app/mcp", "headers": { "Authorization": "Bearer ${env:PORT_API_KEY}" } } }} ``` ```sh { "servers": { "port": { "type": "http", "url": "https://getport.app/mcp", "headers": { "Authorization": "Bearer ${env:PORT_API_KEY}" } } }} ``` ## The tools Every tool reads. There are 12 of them, one per question, and each answers with the same figures as its endpoint. `port_refresh` is only listed when you allowed refresh, on the Allow page or when you made the key; otherwise it does not exist. | Tool | What it answers | Same figures as | | ------------------ | -------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `port_overview` | what is my port worth, by wallet, and what is not counted | [`GET /api/v1/port`](https://docs.getport.app/api/reference/port/) | | `port_holdings` | what do I hold, how much of it, and what is each row priced at | [`GET /api/v1/holdings`](https://docs.getport.app/api/reference/holdings/) | | `port_positions` | what do I have in DeFi | [`GET /api/v1/positions`](https://docs.getport.app/api/reference/positions/) | | `port_perps` | what perps do I have open | [`GET /api/v1/perps`](https://docs.getport.app/api/reference/perps/) | | `port_predictions` | what prediction markets am I in | [`GET /api/v1/predictions`](https://docs.getport.app/api/reference/predictions/) | | `port_nfts` | what NFTs do I hold and what are their floors | [`GET /api/v1/nfts`](https://docs.getport.app/api/reference/nfts/) | | `port_pnl` | how did my trades do, realised and unrealised | [`GET /api/v1/pnl`](https://docs.getport.app/api/reference/pnl/) | | `port_activity` | what moved in my wallets recently | [`GET /api/v1/activity`](https://docs.getport.app/api/reference/activity/) | | `port_briefing` | what does my briefing say today | [`GET /api/v1/briefing`](https://docs.getport.app/api/reference/briefing/) | | `port_alerts` | which of my alerts have fired | [`GET /api/v1/alerts`](https://docs.getport.app/api/reference/alerts/) | | `port_wallets` | which wallets are on my account | [`GET /api/v1/wallets`](https://docs.getport.app/api/reference/wallets/) | | `port_refresh` | read my wallets again now | [`POST /api/v1/refresh`](https://docs.getport.app/api/reference/refresh/) | ## What an answer looks like Each tool answers with a short text block and the figures beside it. - **The text leads with the caveat.** On `port_overview` and `port_holdings`, whose answers can leave something out of a headline, the text starts with the sentence saying what, the same one Port\_ prints under its own figures. Then comes one line of what came back, then how old it is where the answer has a read time. An agent reads the first sentence, and a figure without its caveat misleads by omission. - **The figures are the endpoint’s `data`**, as the tool’s structured content, with `asOf` and `notCounted` inside them, because some clients read only this part. `port_overview` sends `chainsRead`, a count, and `chainsWithGaps`, the chains that answered short or are still reading, in place of the full per-chain list, and `port_holdings` pages at 100 rows rather than 500. A tool takes the same arguments as its endpoint’s query parameters, with the same names. - **A refusal inside a call is an MCP error result** with a sentence in it rather than a figure: out of refreshes for the day, no briefing yet or none for that day, a cursor that is not one of ours, or a day that is not `YYYY-MM-DD`. - **Everything else is refused before the MCP server sees the request**, as plain HTTP with the same bodies the REST API uses: `401` for a missing, revoked or expired key, or a sign-in that was disconnected or has run out (its header says where to sign in again), `402` for a plan without the API (“Agents, MCP and the API are on Pro+ and above.”), `403` for a browser page on another site, and `429` past the minute, day or per-address limit. The [errors](https://docs.getport.app/api/#errors) section has each body. ## Limits The MCP server shares the API’s limits, across the whole account, REST and MCP together: | Plan | Requests a minute | Requests a day | Refreshes a day | | ----------------------- | ----------------- | -------------- | --------------- | | Pro+ | 300 | 25,000 | 3 | | Ultra (not on sale yet) | 600 | 100,000 | 3 | Free and Pro have no API. Every limit is per account, shared by every key, REST, MCP and every app you connect by signing in. Every request to `/mcp` counts, not only tool calls, so the client’s `initialize` and `tools/list` spend from the same allowance. `port_refresh` spends the same refreshes a day as `POST /api/v1/refresh`, so a second door is not a second allowance. The server is stateless: every call is one POST with a JSON reply, the key or sign-in is checked on every call, `tools/list` included, and a sign-in’s Allow is checked again each time, which is why Disconnect stops an app at once, and a deploy costs a client nothing. It answers one request per call, so a batch is refused, and a GET answers 405 rather than holding a stream open.