scale-gp-mcp
v0.1.0-alpha.8
Published
The official MCP Server for the Scale GP API
Readme
Scale GP TypeScript MCP Server
It is generated with Stainless.
Installation
Direct invocation
You can run the MCP Server directly via npx:
export SGP_API_KEY="My API Key"
export SGP_ACCOUNT_ID="My Account ID"
export SGP_CLIENT_ENVIRONMENT="production"
npx -y scale-gp-mcp@latestVia 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": {
"scale_gp_api": {
"command": "npx",
"args": ["-y", "scale-gp-mcp", "--client=claude", "--tools=dynamic"],
"env": {
"SGP_API_KEY": "My API Key",
"SGP_ACCOUNT_ID": "My Account ID",
"SGP_CLIENT_ENVIRONMENT": "production"
}
}
}
}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:
--toolincludes a specific tool by name--resourceincludes all tools under a specific resource, and can have wildcards, e.g.my.resource*--operationincludes 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 queryget_api_endpoint_schema- Gets detailed schema information for a specific endpointinvoke_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.
--client=<type>: Set all capabilities based on a known MCP client- Valid values:
openai-agents,claude,claude-code,cursor - Example:
--client=cursor
- Valid values:
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 schemasvalid-json: Enable JSON string parsing for argumentsrefs: Enable support for $ref pointers in schemasunions: Enable support for union types (anyOf) in schemasformats: 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
- Available capabilities:
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_cardsImporting the tools and server individually
// Import the server, generated endpoints, or the init function
import { server, endpoints, init } from "scale-gp-mcp/server";
// import a specific tool
import createCompletions from "scale-gp-mcp/tools/completions/create-completions";
// initialize the server and all endpoints
init({ server, endpoints });
// manually start server
const transport = new StdioServerTransport();
await server.connect(transport);
// or initialize your own server with specific tools
const myServer = new McpServer(...);
// define your own endpoint
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!' };
})
};
// initialize the server with your custom endpoints
init({ server: myServer, endpoints: [createCompletions, myCustomEndpoint] });Available Tools
The following tools are available in this MCP server.
Resource completions:
create_completions(write): Completions
Resource chat.completions:
create_chat_completions(write): Chat Completionsmodels_chat_completions(read): List Chat Completion Models
Resource inference:
create_inference(write): Generic Inference
Resource questions:
create_questions(write): Create Questionretrieve_questions(read): Get Questionlist_questions(read): List Questions
Resource files:
create_files(write): Upload Fileretrieve_files(read): Get Fileupdate_files(write): Update Filelist_files(read): List Filesdelete_files(write): Delete File
Resource files.content:
retrieve_files_content(read): Get File Content
Resource models:
create_models(write): Create Modelretrieve_models(read): Get Modelupdate_models(write): Update Modellist_models(read): List Modelsdelete_models(write): Delete Model
Resource datasets:
create_datasets(write): Create Datasetretrieve_datasets(read): Get Datasetupdate_datasets(write): Update Datasetlist_datasets(read): List Datasetsdelete_datasets(write): Delete Dataset
Resource evaluations:
create_evaluations(write): Create Evaluationretrieve_evaluations(read): Get Evaluationupdate_evaluations(write): Update Evaluationlist_evaluations(read): List Evaluationsdelete_evaluations(write): Archive Evaluation
Resource dataset_items:
retrieve_dataset_items(read): Get Dataset Itemupdate_dataset_items(write): Update Dataset Itemlist_dataset_items(read): List Dataset Itemsdelete_dataset_items(write): Delete Dataset Itembatch_create_dataset_items(write): Batch Create Dataset Items
Resource evaluation_items:
retrieve_evaluation_items(read): Get Evaluation Itemlist_evaluation_items(read): List Evaluation Items
Resource spans:
create_spans(write): Create Spanretrieve_spans(read): Get Spanupdate_spans(write): Update Spanbatch_spans(write): Create Spans in Batchsearch_spans(write): Search and list spansupsert_batch_spans(write): Upsert Spans in Batch
