Wren MCP

JSON-RPC examples

Raw requests against the live server. Responses shown are real output; long ones are shortened with an ellipsis.

1. Initialize

Request
curl -s https://mcp.wrenapp.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
Response
{
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": {
      "tools": { "listChanged": true },
      "resources": { "listChanged": true }
    },
    "serverInfo": { "name": "wren", "version": "0.1.0" },
    "instructions": "Wren writes real, editable handwritten ink into the user's Wren notebook. write_notebook_page writes one page: ..."
  },
  "jsonrpc": "2.0",
  "id": 1
}

2. List tools

Returns every tool with its input schema, annotations and security schemes. To print just the names (needs jq):

Request
curl -s https://mcp.wrenapp.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
  | sed 's/^data: //' | grep '^{' \
  | jq -r '.result.tools[].name'
Response
write_notebook_page
plan_notebook
list_recent_notebooks
get_note
draw_figure
get_profile
connect_account
list_notes

3. Read one tool’s schema (no token)

The full input schema of each tool is in the tools/list result. This prints the parts of draw_figure a client needs first: its hints, scope, required fields and figure kinds.

Request
curl -s https://mcp.wrenapp.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
  | sed 's/^data: //' | grep '^{' \
  | jq -c '.result.tools[] | select(.name=="draw_figure")
      | {name, annotations, scopes: ._meta.securitySchemes, required: .inputSchema.required,
         kinds: .inputSchema.properties.figure.properties.kind.enum}'
Response (reformatted)
{
  "name": "draw_figure",
  "annotations": {
    "title": "Draw one figure in Wren",
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true,
    "idempotentHint": false
  },
  "scopes": [{ "type": "oauth2", "scopes": ["notes.write"] }],
  "required": ["figure"],
  "kinds": ["graph_2d", "table", "bar_chart", "timeline", "flowchart", "mindmap",
            "concept_map", "formula", "labelled_diagram", "shapes", "number_line"]
}

4. Call a protected tool with no token

Request
curl -s https://mcp.wrenapp.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_profile","arguments":{}}}'
Response
HTTP/2 401
www-authenticate: Bearer resource_metadata="https://mcp.wrenapp.ai/.well-known/oauth-protected-resource/mcp", error="invalid_token", error_description="Link your Wren account", scope="notes.read notes.write profile.read"

{"jsonrpc":"2.0","error":{"code":-32001,"message":"Link your Wren account to continue."},"id":3}

This is where OAuth starts. See Authentication.

5. Draw a graph into a new note (needs a token with notes.write)

Set WREN_ACCESS_TOKEN to an access token obtained through the OAuth flow, then:

Terminal
curl -s https://mcp.wrenapp.ai/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -H "authorization: Bearer $WREN_ACCESS_TOKEN" \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"draw_figure","arguments":{"title":"Quadratics","subject":"Algebra","figure":{"kind":"graph_2d","content":{"prompt":"y = x^2 - 4"}}}}}'

The result’s structuredContent carries noteId, pageNumber and noteUrl, a private link that opens the note after the user signs in. The note appears in the user’s notebook and syncs to their iPad. Swap in any tool from the tool reference.

6. GET is not supported

The server is stateless and POST-only:

Response to GET
HTTP/2 405

{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed (stateless MCP server)."},"id":null}