MCP server
Pixling is preparing for Mac App Store release. Join the waitlist on pixling.app to hear when it launches.
Pixling exposes a loopback Streamable HTTP MCP server directly inside the app while MCP connection is turned on in Settings › Connect.
http://127.0.0.1:48271/mcpIf you are connecting an existing coding agent, start with Connect an agent. For the tool list and underlying vocabulary, see MCP tools and Operations.
Connection
Section titled “Connection”There is no stdio transport and no separate helper process. Pixling never binds to 0.0.0.0, a LAN interface, or the IPv6 wildcard.
- Fixed port (
48271): If another app already holds port48271, Pixling does not open MCP and shows a notice at the bottom of Settings › Connect (the CLI keeps working). Quit the other app, then toggle MCP connection off and on. - Optional bearer token: Protect MCP connection is off by default. Turning it on generates a 256-bit base64url token and requires
Authorization: Bearer <TOKEN>on every request. Copy in Studio includes the header in its snippets (Set up your agent). - Token lifecycle: Toggling MCP connection or Protect MCP connection off deletes the stored token, and turning it back on generates a new one. Tokens never appear in URLs, MCP messages, tool results, or logs.
Transport
Section titled “Transport”Pixling implements Streamable HTTP per the Streamable HTTP 2026-07-28 and Streamable HTTP 2025-11-25 specifications and the Codex MCP setup.
curl -s http://127.0.0.1:48271/mcp \ -H 'Accept: application/json, text/event-stream' \ -H 'Content-Type: application/json' \ -H 'MCP-Protocol-Version: 2026-07-28' \ -H 'Mcp-Method: tools/call' \ -H 'Mcp-Name: pixling_residents_list' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"curl","version":"1.0"},"io.modelcontextprotocol/clientCapabilities":{}},"name":"pixling_residents_list","arguments":{}}}'| Method | Behavior |
|---|---|
POST |
Sends one JSON-RPC message; returns one application/json object. Notifications return 202 Accepted with no body. |
GET |
Returns 405 Method Not Allowed (Pixling does not use SSE streams). |
DELETE |
Ends the session in MCP-Session-Id and returns 204 No Content. |
Limits and HTTP checks
Section titled “Limits and HTTP checks”| Check or limit | Rule |
|---|---|
| Sessions | Up to 200 in memory, with no idle timeout. Creating a 201st drops the oldest-created session, even if still active. |
| Request size & concurrency | Headers 32 KiB, body 1 MiB, 200 concurrent connections. No chunked transfer or HTTP pipelining; each connection handles one request and closes. |
| Caching | Every response sets Cache-Control: no-store. |
Host header |
Must be 127.0.0.1:<PORT> or localhost:<PORT> (case-insensitive). Missing or mismatched Host gets HTTP 403 before protocol parsing to block DNS rebinding. |
Origin header |
When present, must be http://127.0.0.1[:PORT] or http://localhost[:PORT]; anything else gets HTTP 403. |
| Bearer token | When protection is on, verified before protocol parsing. |
Under RFC 9110, a Host header without a port implies port 80 and passes only if the listening port is 80.
Protocol versions
Section titled “Protocol versions”Pixling serves two MCP protocol profiles on the same endpoint:
| Profile | Revisions | Session model | Metadata headers |
|---|---|---|---|
| Negotiated | 2025-11-25, 2025-06-18 |
Stateful (MCP-Session-Id) |
MCP-Session-Id, MCP-Protocol-Version |
| Per-request metadata | 2026-07-28 |
Stateless | MCP-Protocol-Version, Mcp-Method, Mcp-Name |
Negotiated (2025-11-25, 2025-06-18)
Section titled “Negotiated (2025-11-25, 2025-06-18)”Used by Codex and clients targeting the 2025 specifications.
- Follows
initialize→notifications/initializedand returns a cryptographically randomMCP-Session-Id. Subsequent requests must send bothMCP-Session-IdandMCP-Protocol-Version. - Holds up to 200 sessions in memory and clears them when MCP stops.
- Automatic rebinding: If an unknown
MCP-Session-Idarrives with a negotiatedMCP-Protocol-Version(for example after an app restart), Pixling rebinds that ID as ready so the client continues without re-initializing. - Handshake edge cases: An
initializeon an unknown ID or a rebound session redoes the handshake under that ID. A secondinitializeon an already-initialized session fails with-32600. - Unknown session or version: An unknown session without a version header returns HTTP
404and JSON-RPC-32001(Session not found). An unrecognizedMCP-Protocol-Versionreturns HTTP400. - Tool results keep the standard shape of that protocol generation and omit
ttlMsandcacheScope.
Per-request metadata (2026-07-28)
Section titled “Per-request metadata (2026-07-28)”- Stateless transport: no session is created, and each
POSTvalidates_meta.io.modelcontextprotocol/*(protocolVersion,clientInfo, andclientCapabilities). MCP-Protocol-Version,Mcp-Method, and (fortools/call)Mcp-Nameheaders must match the request body; mismatches return HTTP400with JSON-RPC-32020.- Notifications (
POSTwith noid) return HTTP202with no body. Their headers and_metaare not checked because the revision defines none for notifications. - Unimplemented methods return HTTP
404with JSON-RPC-32601(the negotiated profile uses the standard JSON-RPC response shape). server/discoverandtools/listreturn Caching (SEP-2549) metadata:ttlMs: 0, becausetools/listis filtered per request by live capabilities and user-toggled groups (Core and groups), andlistChangedis never sent.cacheScope: "private", because this is a personal loopback server.
Shared rules for both profiles
Section titled “Shared rules for both profiles”- Every tool’s input schema is a closed root object (
additionalProperties: false). Per-tool contracts live in Messages and questions, Residents, Resident settings, and the other reference pages. - Only the
toolscapability is advertised. Resources, prompts, Tasks, subscriptions, and server-initiated requests are not offered. - Every call runs as the fixed identity
mcp:local-mcp. Requester identity is never read from the HTTP payload orclientInfo(clientInfois only used to validate the protocol peer).
Results and errors
Section titled “Results and errors”Every tool result places the same control document as CLI --json in structuredContent and mirrors that JSON as text content for compatibility. Tools declare no output schema. The 2026-07-28 profile also adds resultType: "complete" and _meta.
{ "jsonrpc": "2.0", "id": 1, "result": { "resultType": "complete", "content": [ { "type": "text", "text": "{\"invocationID\":\"mcp-01234567-89ab-cdef-0123-456789abcdef\",\"ok\":true,\"operation\":\"residents.list\",\"protocolVersion\":1,\"result\":{\"displays\":[...],\"residents\":[...]}}" } ], "structuredContent": { "ok": true, "operation": "residents.list", "invocationID": "mcp-01234567-89ab-cdef-0123-456789abcdef", "protocolVersion": 1, "result": { "displays": [ { "id": "display-1", "name": "Built-in Retina Display", "isMain": true, "backingScaleFactor": 2, "frame": { "x": 0, "y": 0, "width": 1512, "height": 982 }, "visibleFrame": { "x": 0, "y": 0, "width": 1512, "height": 945 }, "displayUUID": null, "safeAreaTop": 37, "auxiliaryTopLeftArea": null, "auxiliaryTopRightArea": null } ], "residents": [ { "entityID": "11111111-2222-3333-4444-555555555555", "selector": "No.7#1", "name": "Moku", "number": 7, "layer": "floating", "visibility": "visible", "presence": "everywhere", "displayID": "display-1", "footprint": { "x": 1180, "y": 48, "width": 160, "height": 160 }, "size": 160 } ] } }, "isError": false, "_meta": { "io.modelcontextprotocol/serverInfo": { "name": "Pixling", "version": "1.0.0" } } }}Results evolve additively: ignore unknown fields and enum values. Calls using a deprecated form include deprecations beside result (see CLI: Compatibility). tools/list does not mark deprecated tools.
| Case | Returned as |
|---|---|
| Unknown tool or malformed JSON-RPC / params / metadata | JSON-RPC protocol error (-32602 and others) |
| Refused tool argument | Tool result (isError: true) with error.code: "invalidArguments" |
| App unavailable, target not found, or domain rejection | Typed tool result (isError: true) |
| Rate limit (1000 req/s per ingress) | Tool result (isError: true) with error.code: "rateLimited" |
| Internal server failure (such as encoding) | JSON-RPC -32603 |
Refused tool arguments
Section titled “Refused tool arguments”An unreadable value, unknown key, or missing required key never reaches the app. Pixling returns it as a tool result (isError: true) rather than a JSON-RPC error because many hosts hide JSON-RPC errors from the model:
{ "ok": false, "operation": "sequence.start", "invocationID": "...", "protocolVersion": 1, "error": { "code": "invalidArguments", "field": "steps[2].to", "problem": "...", "hint": "..." }}Other error behaviors
Section titled “Other error behaviors”- Unknown tool: Tells the client to refresh
tools/listor reconnect when the cached tool list disagrees with the running app build. - Runaway fence (
rateLimited): Caps each ingress at 1000 requests/second to stop infinite loops, not as a quota. It is distinct from domainrejectedso hosts can back off and retry. - Build identification:
capabilities.getreturns each operation’s{id, access}(withdeprecatedwhen scheduled for removal) andapp {version, build, commit, protocolVersion}(commitisunknownwhen unavailable). Compare this against the caller’s build (CLI:pixling --version) after an unknown tool orunknownOperation. - Per-resident message receipts:
message.sendsucceeds per resident, so the call staysok; unshown entries carryrejection,heldBecause, andhintinside their receipt (Messages and questions). - Unbound or stowed clients:
inbox.watchon an unbound namespace/key returnsrejected/notBoundimmediately without waiting (Inbox). Targeting an unbound or stowedclient:<namespace>/<key>returnstargetNotFoundwith a hint to checkresident.ensureforonDeskvs.stowed(Resident binding). - Opaque
promptID: PasspromptIDonly fromquestion.asktoquestion.resultorquestion.cancel(Messages and questions).
See Read refusals for recovery patterns.
Trust boundary
Section titled “Trust boundary”1. Explicit opt-in in Settings (nothing listens when CLI & MCP are off)2. Loopback-only binding (127.0.0.1:48271)3. Origin validation + Host validation (anti-DNS-rebinding)4. Optional 256-bit bearer token5. Fixed client identity (mcp:local-mcp)6. Closed allowlist of operations + user-toggleable tool groups7. Limits: 200 concurrent connections, 1000 req/s runaway fence per ingress