This TypeScript SDK provides a client interface for interacting with the MCP Kit API.
npm install @mcpkit/server-sdk
# or yarn add @mcpkit/server-sdk
# or pnpm add @mcpkit/server-sdk
import { McpServerClient } from "@mcpkit/server-sdk";
const apiKey = process.env.MCPKIT_API_KEY; // Ensure this is set
if (!apiKey) {
throw new Error("MCPKIT_API_KEY environment variable is not set.");
}
const client = new McpServerClient(apiKey);
async function listServers() {
try {
const servers = await client.getServers();
console.log("Available Servers:", servers);
if (servers.length > 0) {
const firstServerId = servers[0].id;
const tools = await client.getToolsForServer(firstServerId);
console.log(`Tools for server ${firstServerId}:`, tools);
}
} catch (error) {
console.error("Error interacting with MCP Kit Server:", error);
}
}
listServers();
-
Install Dependencies:
npm install # or yarn install / pnpm install
-
Build:
This compiles TypeScript files from
npm run build # Or equivalent script (likely runs tsc)
src/
to JavaScript indist/
.