Skip to main content
Model Context Protocol

Build against DIS without leaving your editor

Connect Cursor, Claude, or VS Code. Search the API catalogue, inspect your applications, manage sandbox data, and set up Login with SLUDI β€” using the same login as the developer portal.

CursorClaudeVS CodeCodexWindsurfZed

API catalogue

Search the catalogue, switch versions, and pull OpenAPI plus endpoint detail into chat.

Your applications

List apps you already registered. Read clientId, subscribed API names, and whether SLUDI API is selected.

Playground seed data

Read, update, or reset isolated seed tables for an application you own.

Sandbox collections

Read and update USER collection records β€” the sandbox citizens used with SLUDI.

Login with SLUDI

Register an OIDC client for an app you own, keep the portal Try Out callback, and get the eSignet authorize URL.

Creating apps and live API try-out stay in the developer portal. Completing eSignet login stays in your own app. Keep API keys out of MCP. Save the SLUDI private key when create returns it β€” a later lookup does not include the key.

Build in your own app​

Creating the application and calling sandbox APIs happen in the developer portal and in your code. The assistant can look up your clientId and the API contract. It cannot create the app or use your API key.

  1. In the developer portal, open My Applications β†’ Create Application. Complete application details, select at least one API, add an IP whitelist, then register. Select SLUDI API if you need Login with SLUDI. See Managing My Applications β†’.
  2. Copy the sandbox API key when the portal shows it. Store it in a secrets manager or an environment variable. It is shown again only if you rotate the key on the application card. Do not paste the key into chat.
  3. Ask the assistant for the application clientId. From your own code, send both headers on every sandbox call:
X-DIS-CLIENT-ID: <clientId>
X-DIS-API-KEY: <sandbox API key>

The caller IP must be on that application's whitelist, and the application must be subscribed to the API. Try the call in Playground before you rely on it. Gateway codes such as a missing key or a client id that is not allowed are listed in Gateway Errors β†’.

Connect your assistant​

Pick your client and copy the snippet. The MCP server URL for this environment is already filled in β€” you do not need to edit it. Sign in with the same account you use on the developer portal.

Filled in from this environment Β· paste configs as-ishttps://mcp.staging.devportal.gov.lk/mcp
  1. Click Add to Cursor, or paste the JSON below as-is into ~/.cursor/mcp.json (or .cursor/mcp.json in a project).
  2. Choose Connect and sign in with the same account you use on the developer portal.
  3. Confirm tools such as search_apis and list_my_applications appear.
~/.cursor/mcp.json
{
"mcpServers": {
"dis": {
"url": "https://mcp.staging.devportal.gov.lk/mcp",
"auth": {
"CLIENT_ID": "dis-mcp",
"scopes": [
"openid",
"profile",
"email",
"offline_access"
]
}
}
}
}

Try it​

After the server shows as connected, paste a prompt. For seed data, ask the assistant to call list_my_applications first so it has a clientId. For sandbox collections and Login with SLUDI, use the application id from that same list.

Discover APIs

Search the DIS catalogue for vehicle APIs and summarize the versions, auth methods, and main endpoints.

Inspect my apps

List my applications and show the clientId, subscribed API names, and whether each one is ready for SLUDI.

Read seed data

For my application, show playground seed tables and a sample of rows. Prefer get_seed_tables then get_seed_table_rows.

Reset playground

Reset playground seed data for this application to the template initial seed, then confirm the table row counts.

Sandbox citizens

For my SLUDI application, list the USER collection, show the schema, and sample a few citizen records. Call get_collection before changing any record.

Call an API from my app

Show how to call one of my subscribed APIs from my own application. Use my clientId from list_my_applications. Remind me to keep the sandbox API key in an environment variable and send X-DIS-CLIENT-ID and X-DIS-API-KEY. Do not ask me to paste the key.

Login with SLUDI

For my application that has SLUDI API selected, show the SLUDI OIDC client and build the eSignet authorize URL. If none exists, register one with my app callback URL and remind me to save the private key.

Tools​

Catalogue

Read only
  • search_apisSearch the catalogue by name or category
  • get_api_summarySummary for an apiId
  • get_api_versionsPublished and unpublished (deprecated) versions
  • get_api_documentationFull OpenAPI for apiId + apiVersionId
  • get_api_endpointsEndpoint list for a version
  • get_endpoint_detailEndpoint detail and samples

Applications

Read only
  • list_my_applicationsid, name, clientId, subscribed API names, SLUDI eligibility
  • get_applicationSame fields for one application

Playground seed data

Read / write
  • get_playground_contextTable names and row counts
  • get_seed_tablesSummary of tables in the current state
  • get_seed_table_rowsRows for one table (default 50, max 200)
  • update_seed_tableReplace one table (max 500 rows)
  • reset_seed_dataReset isolated client state to the template seed

Sandbox collections

Read / write
  • list_collectionsEligible collections (for example USER) for an application you own
  • get_collectionMeta and effective schema, including SLUDI extensions
  • list_collection_recordsCitizen records (default 50, max 200)
  • get_collection_recordOne record by record id
  • create_collection_recordCreate a record matching the collection schema
  • update_collection_recordPatch fields on one record
  • delete_collection_recordDelete one record
  • reset_collection_to_seedReplace records with the admin seed (confirm required)

Login with SLUDI

Read / write
  • get_sludi_oidc_clientExisting OIDC client. The private key is never returned
  • create_sludi_oidc_clientRegister a client with your callback URL. Private key is returned once
  • update_sludi_oidc_clientAdd or replace redirect URIs, ACR values, or logo. Does not rotate keys
  • get_sludi_authorize_urlBuild the eSignet authorize URL to open in a browser

Seed tools need a clientId from list_my_applications that belongs to your organisation and is subscribed to the requested API version. Collection and SLUDI tools use that application's id. Select SLUDI API on the application first. Pass your app callback when creating the OIDC client; the portal Try Out callback is kept automatically (five redirect URIs maximum). Prefer addRedirectUris when adding another callback later. Open the authorize URL in a browser β€” exchanging the code stays in your app. Register apps in My Applications.

Limits and troubleshooting​

20Max catalogue / app page size
60 / 10Requests / write tools per minute
200Max seed or collection rows per read
How sign-in works

Use the same account as the developer portal. Your MCP client opens a browser login, then keeps you signed in for tool calls. You never paste API keys into MCP config.

Connect fails or sign-in errors

Confirm the endpoint on this page, then disconnect and try again. Cursor completes login in the browser using a local callback at http://localhost:8787/callback.

Tools load but applications are empty

Disconnect, reconnect, and sign in again so your organisation is picked up.

401 on every call

Reconnect and complete browser sign-in again. Do not paste an access token by hand.

My client only supports local stdio MCP

Use the mcp-remote bridge under Other clients. Fully quit and relaunch the host after editing config.

Seed tools reject clientId

The application must belong to your organisation and be subscribed to that API version. Create or subscribe in My Applications.

Where the API key fits

Create the application in My Applications. The sandbox API key is shown once β€” store it outside this chat. Your own code sends X-DIS-CLIENT-ID (the clientId from list_my_applications) and X-DIS-API-KEY. The caller IP must be on the application whitelist. See Gateway Errors if a call is rejected.

SLUDI tools say the application is not eligible

Select SLUDI API on the application in My Applications. If you just selected it, wait for the USER collection to be provisioned, then call list_collections again.

An ACTIVE SLUDI client already exists

Use update_sludi_oidc_client with addRedirectUris to add a callback. Creating another client is refused while one is active. Key rotation stays in the developer portal. The private key from create cannot be fetched again.