A TypeScript-based client library for managing Model Context Protocol (MCP) servers, sessions, and tools with settings management and session persistence.
This is a TypeScript HTTP client for an MCP server, not an MCP server itself. It provides 8 tool wrappers (callTool, createContext, addMessages, run, listPrompts, getPrompt, runPrompt, chat) that proxy requests to a remote MCP server. Tool definitions exist with schemas and descriptions, but lack depth expected of production tools. Naming is reasonably clear (verb-first), but descriptions are generic and lack context for LLM selection. Parameter descriptions are minimal. No output schema documentation visible. No error handling guidance beyond basic error objects. The server delegates core logic to a remote endpoint, actual validation, permission gating, and recovery guidance should exist but are not visible in this client code. Per-tool analysis reveals consistent structural gaps across all 8 tools.
Add messages to the current context
Call a tool in the current context with specified parameters
Convenience method to create a context and send a message in one call, returning the assistant's response
Create a new context in the MCP server with optional messages, tools, and system prompt
Get details of a specific prompt including its template and parameters
List available prompts on the MCP server
Run the model in the current context and get the assistant's response
Run a prompt on the server with optional arguments
Generic descriptions lack LLM-selection guidance. 'Call a tool in the current context' does not explain when to use callTool vs run vs runPrompt. LLMs cannot distinguish tool purpose without explicit context.
Parameter descriptions are minimal or missing. 'Parameters to pass to the tool' (callTool.parameters) does not explain format, constraints, required vs optional fields, or how to construct the object. LLMs will guess.
No output schema documentation. Response structures (e.g., ToolCallResponse, RunResponse) are defined in types/index.ts but not visible in tool descriptions. LLMs cannot plan downstream tool calls without knowing return fields.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 42 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 36 | - | v1 |
Error responses include bare error objects with optional 'message', 'code', 'type' fields. No guidance on recovery actions. LLMs receive 'error: {message: "..."} ' with no next-step instructions. Should include 'retry' vs 'user-fixable' vs 'fatal' classification.
Naming ambiguity: 'run' is generic. Does it advance the conversation? Execute pending tool calls? Generate a response? Should be 'run_inference' or 'get_assistant_response'. Similar ambiguity in 'callTool', should be 'execute_tool' or 'invoke_tool'.
No pagination or result limits documented. If listPrompts or getPrompt return large result sets, no 'limit', 'offset', or 'page' parameters visible. Unbounded results can blow context windows.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) visible in definitions. createContext, addMessages, run, runPrompt, and chat are WRITE operations per schema. LLMs cannot infer safety without explicit hints.
createContext accepts 'roots' parameter (filesystem roots, a deprecated MCP feature as of 2026). Should document migration to passing files/dirs via tool parameters or resource URIs instead.