{
  "openapi": "3.1.2",
  "info": {
    "title": "Transit Data MCP",
    "description": "Transit Data MCP is a [Model Context Protocol](https://modelcontextprotocol.io)\n(MCP) server over Entur's NeTEx-derived transit reference data. Connect it\nto an MCP-capable AI client and the assistant can look up lines, service\njourneys, the quays they call at, stop places, operators and authorities,\nand page through any of them.\n\n### Connecting\n\nPoint your MCP client at `https://api.entur.io/transit-data/v1beta/mcp`.\nThe endpoint is public and needs no authentication. Identify your client\nwith the `ET-Client-Name` header, in the form `<company>-<application>`\n(lowercase, no spaces); see\n[Client identification](https://developer.entur.org/docs/getting-started#client-identification-et-client-name).\n\n### Tools\n\nEach kind of entity has a read-only tool that looks up one entity by\nidentifier (`serviceJourney`, `quay`, `line`, ...) and one that pages through\nthem (`serviceJourneys`, `quays`, `lines`, ...). Experimental data\n(real-time departures, geo-queries, `activeDates`) is not offered as tools and\nis rejected if requested through `fields`.\n\nA tool takes its own arguments, plus an optional `fields`:\n\n- `fields` is a GraphQL selection set for the entity the tool returns,\n  such as `id line { id name }`. Without it, a tool returns the entity's\n  scalar and enum fields. Each tool's `fields` description lists what can\n  be selected on that entity, one level deep.\n- A tool that returns a page (`quays`, `lines`, ...) takes `first` and\n  `after`. The result has the entities under `nodes` (under\n  `edges { node }` for `datedServiceJourneys`) and a `pageInfo` with\n  `hasNextPage` and `endCursor`; pass `endCursor` as `after` for the next\n  page. For these tools `fields` describes one entity, not the page.\n\n### Tool results\n\nA tool result carries the GraphQL response as JSON text in `content[0].text`:\n`{\"data\": ...}` on success. When the call did not do what it asked for (a\nmissing required argument, an unknown or experimental field, an invalid\n`fields`), the result has `isError: true` and the text is `{\"errors\": [...]}`\nor a plain message. An unknown tool name is reported the same way, not as a\nJSON-RPC error.\n\n### Transport\n\nThe server speaks Streamable HTTP in stateless mode, so any replica can\nanswer any request. See the `/mcp` operation for the details and the status\ncodes.\n",
    "termsOfService": "https://developer.entur.no/terms-of-service",
    "contact": {
      "name": "Team RoR"
    },
    "version": "2026.10.1",
    "summary": "MCP server over Norwegian public transport reference data (NeTEx): lines, service journeys, quays, stop places, operators, authorities and journey patterns, with read-only tools to look up one entity or page through many.",
    "x-stability-level": "beta"
  },
  "servers": [
    {
      "url": "https://api.entur.io/transit-data/v1beta",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "MCP",
      "description": "The Model Context Protocol endpoint."
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "summary": "Transit Data MCP server",
        "description": "Streamable HTTP MCP endpoint in stateless mode: each POST carries one\nJSON-RPC message. A request (a message with an `id`) receives a\nsynchronous `application/json` response; a notification (no `id`, for\nexample `notifications/initialized`) is acknowledged with `202 Accepted`.\nThere is no session and no SSE stream. Only `POST` is supported: `GET`\nand `DELETE` answer `405`.\n\nAs the Streamable HTTP transport requires, every POST must send\n`Content-Type: application/json` and\n`Accept: application/json, text/event-stream`, even though the server\nonly ever answers with JSON. A POST that does not is refused with `406`\n(`Accept`) or `415` (`Content-Type`), each with a JSON-RPC error body.\n\nA JSON-RPC level failure, such as an unknown method, is answered with\n`200` and a JSON-RPC `error`. A failed tool call is a `200` with a\nresult whose `isError` is `true`.\n\nNo authentication is required. Send the `ET-Client-Name` header, as\n`<company>-<application>`, to identify your client.\n",
        "operationId": "mcp",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "description": "Must list both `application/json` and `text/event-stream`, as the MCP Streamable HTTP transport requires.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "example": "application/json, text/event-stream"
          }
        ],
        "requestBody": {
          "description": "A single JSON-RPC 2.0 message per the MCP specification.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "examples": {
                "toolsList": {
                  "summary": "tools/list",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/list"
                  }
                },
                "toolsCall": {
                  "summary": "tools/call, the first page of lines",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": {
                      "name": "lines",
                      "arguments": {
                        "first": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                },
                "examples": {
                  "toolsList": {
                    "summary": "tools/list, one tool of the catalog",
                    "value": {
                      "jsonrpc": "2.0",
                      "id": 1,
                      "result": {
                        "tools": [
                          {
                            "name": "authority",
                            "description": "Query `authority`: returns a Authority, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects.",
                            "inputSchema": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "fields": {
                                  "type": "string",
                                  "description": "A GraphQL selection set for Authority, e.g. `id name`; nested objects take their own braces. Default: id name url timezone lang phone fareUrl. Available: id: ID!, name: String, url: String, timezone: String, lang: String, phone: String, fareUrl: String, lines: [Line!]!"
                                }
                              },
                              "required": [
                                "id"
                              ]
                            }
                          }
                        ]
                      }
                    }
                  },
                  "toolsCall": {
                    "summary": "tools/call, GraphQL response as JSON text",
                    "value": {
                      "jsonrpc": "2.0",
                      "id": 2,
                      "result": {
                        "content": [
                          {
                            "type": "text",
                            "text": "{\"data\":{\"lines\":{\"nodes\":[{\"id\":\"BLI:FlexibleLine:1c8157c4-1ad7-4869-a56a-a3498e29acac\",\"name\":\"Lillesand Blindleia\",\"publicCode\":\"M/S Øya\",\"description\":null,\"url\":null,\"transportMode\":\"water\",\"transportSubmode\":null,\"isReplacement\":false,\"replacementsExist\":false,\"flexibleLineType\":\"fixed\"}],\"pageInfo\":{\"hasNextPage\":true,\"endCursor\":\"MTB8QkxJ\"}}}}"
                          }
                        ],
                        "isError": false
                      }
                    }
                  },
                  "toolsCallError": {
                    "summary": "tools/call, a required argument is missing",
                    "value": {
                      "jsonrpc": "2.0",
                      "id": 3,
                      "result": {
                        "content": [
                          {
                            "type": "text",
                            "text": "{\"errors\":[{\"message\":\"Variable 'id' has an invalid value: Variable 'id' has coerced Null value for NonNull type 'String!'\",\"locations\":[{\"line\":1,\"column\":7}],\"extensions\":{\"classification\":\"ValidationError\"}}]}"
                          }
                        ],
                        "isError": true
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "The message was a JSON-RPC notification (no `id`) and has been accepted. The body carries nothing useful."
          },
          "400": {
            "description": "The body is not valid JSON. The response is a JSON-RPC error with code -32700."
          }
        },
        "security": [],
        "x-mcp-server": {
          "name": "transit-data-mcp",
          "version": "0.1.0",
          "tools": [
            {
              "name": "serviceJourney",
              "description": "Query `serviceJourney`: returns a ServiceJourney, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "line",
              "description": "Query `line`: returns a Line, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "quay",
              "description": "Query `quay`: returns a Quay, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "datedServiceJourney",
              "description": "Query `datedServiceJourney`: returns a DatedServiceJourney, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "authority",
              "description": "Query `authority`: returns a Authority, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "stopPlace",
              "description": "Query `stopPlace`: returns a StopPlace, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "operator",
              "description": "Query `operator`: returns a Operator, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "journeyPattern",
              "description": "Query `journeyPattern`: returns a JourneyPattern, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "groupOfLines",
              "description": "Query `groupOfLines`: returns a GroupOfLines, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "groupsOfLines",
              "description": "Query `groupsOfLines`: returns a page of GroupOfLines in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "operators",
              "description": "Query `operators`: returns a page of Operator in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "journeyPatterns",
              "description": "Query `journeyPatterns`: returns a page of JourneyPattern in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "authorities",
              "description": "Query `authorities`: returns a page of Authority in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "stopPlaces",
              "description": "Query `stopPlaces`: returns a page of StopPlace in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "quays",
              "description": "Query `quays`: returns a page of Quay in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "lines",
              "description": "Query `lines`: returns a page of Line in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "serviceJourneys",
              "description": "Query `serviceJourneys`: returns a page of ServiceJourney in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            },
            {
              "name": "datedServiceJourneys",
              "description": "Query `datedServiceJourneys`: returns a page of DatedServiceJourney in `edges { node }`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
            }
          ]
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "description": "A JSON-RPC 2.0 request as defined by the MCP specification.",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "method": {
            "type": "string",
            "examples": [
              "initialize",
              "tools/list",
              "tools/call"
            ]
          },
          "params": {
            "type": "object"
          }
        },
        "required": [
          "jsonrpc",
          "method"
        ]
      },
      "JsonRpcResponse": {
        "type": "object",
        "description": "A JSON-RPC 2.0 response as defined by the MCP specification.",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "result": {
            "type": "object"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "jsonrpc"
        ]
      }
    },
    "parameters": {
      "ET-Client-Name": {
        "name": "ET-Client-Name",
        "in": "header",
        "description": "Entur Client Header.\nIt is required that all consumers identify themselves by using this header.\nEntur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.\nThe structure of ET-Client-Name should be: `<company>-<application>`.",
        "required": false,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      },
      "X-Correlation-Id": {
        "name": "X-Correlation-Id",
        "in": "header",
        "description": "Correlation id",
        "required": false,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      }
    }
  },
  "x-mcp": {
    "protocolVersion": "2025-06-18",
    "servers": [
      {
        "url": "https://api.entur.io/transit-data/v1beta/mcp"
      }
    ],
    "capabilities": {
      "tools": {}
    },
    "tools": [
      {
        "name": "serviceJourney",
        "description": "Query `serviceJourney`: returns a ServiceJourney, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "line",
        "description": "Query `line`: returns a Line, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "quay",
        "description": "Query `quay`: returns a Quay, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "datedServiceJourney",
        "description": "Query `datedServiceJourney`: returns a DatedServiceJourney, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "authority",
        "description": "Query `authority`: returns a Authority, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "stopPlace",
        "description": "Query `stopPlace`: returns a StopPlace, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "operator",
        "description": "Query `operator`: returns a Operator, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "journeyPattern",
        "description": "Query `journeyPattern`: returns a JourneyPattern, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "groupOfLines",
        "description": "Query `groupOfLines`: returns a GroupOfLines, or null if there is none. Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "groupsOfLines",
        "description": "Query `groupsOfLines`: returns a page of GroupOfLines in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "operators",
        "description": "Query `operators`: returns a page of Operator in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "journeyPatterns",
        "description": "Query `journeyPatterns`: returns a page of JourneyPattern in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "authorities",
        "description": "Query `authorities`: returns a page of Authority in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "stopPlaces",
        "description": "Query `stopPlaces`: returns a page of StopPlace in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "quays",
        "description": "Query `quays`: returns a page of Quay in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "lines",
        "description": "Query `lines`: returns a page of Line in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "serviceJourneys",
        "description": "Query `serviceJourneys`: returns a page of ServiceJourney in `nodes`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      },
      {
        "name": "datedServiceJourneys",
        "description": "Query `datedServiceJourneys`: returns a page of DatedServiceJourney in `edges { node }`, with `pageInfo` (paginate with first and after). Read-only. Returns the scalar and enum fields by default; pass `fields` to choose others, including nested objects."
      }
    ]
  }
}