Limrun TypeScript MCP Server
It is generated with Stainless.
Installation
Direct invocation
You can run the MCP Server directly via npx:
export LIM_TOKEN="My API Key"
npx -y @limrun/api-mcp@latest
Via MCP Client
There is a partial list of existing clients at modelcontextprotocol.io. If you already
have a client, consult their documentation to install the MCP server.
For clients with a configuration JSON, it might look something like this:
{
"mcpServers": {
"limrun_api_api": {
"command": "npx",
"args": ["-y", "@limrun/api-mcp", "--client=claude", "--tools=all"],
"env": {
"LIM_TOKEN": "My API Key"
}
}
}
}
Exposing endpoints to your MCP Client
There are two ways to expose endpoints as tools in the MCP server:
- Exposing one tool per endpoint, and filtering as necessary
- Exposing a set of tools to dynamically discover and invoke endpoints from the API
Filtering endpoints and tools
You can run the package on the command line to discover and filter the set of tools that are exposed by the
MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
context window.
You can filter by multiple aspects:
--tool includes a specific tool by name
--resource includes all tools under a specific resource, and can have wildcards, e.g. my.resource*
--operation includes just read (get/list) or just write operations
Dynamic tools
If you specify --tools=dynamic to the MCP server, instead of exposing one tool per endpoint in the API, it will
expose the following tools:
list_api_endpoints - Discovers available endpoints, with optional filtering by search query
get_api_endpoint_schema - Gets detailed schema information for a specific endpoint
invoke_api_endpoint - Executes any endpoint with the appropriate parameters
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
you can opt-in to explicit tools, the dynamic tools, or both.
See more information with --help.
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. --no-tool).
Use --list to see the list of available tools, or see below.
Specifying the MCP Client
Different clients have varying abilities to handle arbitrary tools and schemas.
You can specify the client you are using with the --client argument, and the MCP server will automatically
serve tools and schemas that are more compatible with that client.
Additionally, if you have a client not on the above list, or the client has gotten better
over time, you can manually enable or disable certain capabilities:
--capability=<name>: Specify individual client capabilities
- Available capabilities:
top-level-unions: Enable support for top-level unions in tool schemas
valid-json: Enable JSON string parsing for arguments
refs: Enable support for $ref pointers in schemas
unions: Enable support for union types (anyOf) in schemas
formats: Enable support for format validations in schemas (e.g. date-time, email)
tool-name-length=N: Set maximum tool name length to N characters
- Example:
--capability=top-level-unions --capability=tool-name-length=40
- Example:
--capability=top-level-unions,tool-name-length=40
Examples
- Filter for read operations on cards:
--resource=cards --operation=read
- Exclude specific tools while including others:
--resource=cards --no-tool=create_cards
- Configure for Cursor client with custom max tool name length:
--client=cursor --capability=tool-name-length=40
- Complex filtering with multiple criteria:
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
Running remotely
Launching the client with --transport=http launches the server as a remote server using Streamable HTTP transport. The --port setting can choose the port it will run on, and the --socket setting allows it to run on a Unix socket.
Authorization can be provided via the Authorization header using the Bearer scheme.
Additionally, authorization can be provided via the following headers:
x-lim-token | apiKey | bearerAuth |
A configuration JSON for this server might look like this, assuming the server is hosted at http://localhost:3000:
{
"mcpServers": {
"limrun_api_api": {
"url": "http://localhost:3000",
"headers": {
"Authorization": "Bearer <auth value>"
}
}
}
}
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
For example, to exclude specific tools while including others, use the URL:
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
Importing the tools and server individually
import { server, endpoints, init } from "@limrun/api-mcp/server";
import createAndroidInstances from "@limrun/api-mcp/tools/android-instances/create-android-instances";
init({ server, endpoints });
const transport = new StdioServerTransport();
await server.connect(transport);
const myServer = new McpServer(...);
const myCustomEndpoint = {
tool: {
name: 'my_custom_tool',
description: 'My custom tool',
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
},
handler: async (client: client, args: any) => {
return { myResponse: 'Hello world!' };
})
};
init({ server: myServer, endpoints: [createAndroidInstances, myCustomEndpoint] });
Available Tools
The following tools are available in this MCP server.
Resource android_instances:
create_android_instances (write): Create an Android instance
list_android_instances (read): List Android instances belonging to given organization
delete_android_instances (write): Delete Android instance with given name
get_android_instances (read): Get Android instance with given ID
Resource assets:
list_assets (read): List organization's all assets with given filters. If none given, return all assets.
get_assets (read): Get the asset with given ID.
get_or_create_assets (write): Creates an asset and returns upload and download URLs. If there is a corresponding file uploaded in the storage
with given name, its MD5 is returned so you can check if a re-upload is necessary. If no MD5 is returned, then
there is no corresponding file in the storage so downloading it directly or using it in instances will fail
until you use the returned upload URL to submit the file.