What is the Model Context Protocol?
In the 1980s, the personal computing revolution put a computer in every living room. Much of it was fueled by the idea of a “Graphical User Interface” (GUI), standardizing how humans and programs interacted. Twenty years later, cloud computing put software on the internet. Programs started being developed around APIs (Application Programming Interfaces) instead, standardizing how programs interacted with other and programs. We are on the precipise of agentic computing — programs that can autonomously decide what to do next, solve ambiguous problems, and decide what data and resources they need to accomplish their goals. But we’re still missing a standard way for agents to interact with the rest of the world — an agentic interface layer. The Model Context Protocol (MCP) is a big step in this direction. It’s an open standard developed by Anthropic to help AI models, agents, and systems connect with external data sources and tools.How does MCP work?
The MCP distinguishes between Clients and Servers. Clients are AI applications, like Claude Desktop, Cursor, and Windsurf. Servers expose data and tools to the client, and are usually created by the company or developers that host the data, but there is a rich ecosystem of third-party servers too. In Hyperspell’s case, we’re providing an MCP server that lets you query and add data to your Hyperspell app.Local vs Remote Servers
There are two flavors of MCP servers:- Local servers run on your own machine, and are great for uses cases involving your local files, or even controlling your own hardware.
- Remote servers run in the cloud, and make it easy to connect clients.
Tools, Prompts, and Resources
MCP servers provide clients with tools, resources, prompts, completions, and more. You can read more about them on the Model Context Protocol website, but the Hyperspell MCP server is focused on providing tools and resources:- Tools are actions that can be taken by the client. In our case, we’re providing the tools to query Hyperspell for data, and to add data to Hyperspell either by providing text that Hyperspell should remember, or the URL to a file or web page.
- Resources are data sources that can be queried by the client. For example, a resource could be a file in your local filesystem, or a record in a database. With the Hyperspell MCP server, you retrieve your memories as resources.
Usage
Available Tools
The following tools are available in this MCP server.Memories
search
: Search all memories indexed by Hyperspell. Setanswer
to true to directly answer the query, or to ‘false’ to simply get all memories related to the query.add_memory
: This tool lets you add text, markdown, or JSON to the Hyperspell index so it can be searched later. It will return thesource
andresource_id
that can be used to later retrieve the processed memory.get_memory
: This tool lets you retrieve a memory that has been previously indexed.upload_file
: This tool lets you upload a file to the Hyperspell index. It will return thesource
andresource_id
that can be used to later retrieve the processed memory.
Integration management
list_integrations
: List all available integrationsconnect_integration
: Get a signed url to connect to a given integration. Use thelist_integrations
tool to find the correctintegration_id
for the required provider.user_info
: Get basic info about the current user, including which integrations are currently enabled and which ones are available.
Direct Invocation
You can run the Hyperspell MCP Server directly via npx:Via MCP Client (ie. Claude Desktop)
There is a partial list of existing clients at modelcontextprotocol.io. Please consult the documentation for your client to install the Hyperspell MCP Server. For clients with a configuration JSON such as Claude Desktop, it might look something like this:This file is located in
~/Library/Application Support/Claude/claude_desktop_config.json
on macOS, and %APPDATA%\Claude\claude_desktop_config.json
on Windows.HYPERSPELL_TOKEN
with your Hyperspell app token and the HYPERSPELL_USER_ID
with the ID of the user you want to use the MCP Server for.
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 queryget_api_endpoint_schema
- Gets detailed schema information for a specific endpointinvoke_api_endpoint
- Executes any endpoint with the appropriate parameters
--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:
--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:
Importing the tools and server individually
Source Code
You can explore the source code for the Hyperspell MCP Server on GitHub:Hyperspell MCP Server
Explore the source code for the Hyperspell MCP Server on GitHub.