This MCP server integrates with Typesense to provide a standardized interface for searching across any Typesense collection. It offers a typo-tolerant search experience with support for filtering, faceting, and pagination through the Model Control Protocol.
Configure the server using these environment variables:
TYPESENSE_HOST
: Typesense server host (default: "localhost")TYPESENSE_PORT
: Typesense server port (default: 8108)TYPESENSE_PROTOCOL
: Protocol to use (http/https) (default: "http")TYPESENSE_API_KEY
: Typesense API key (default: "xyz")Build the server with the Go compiler:
go build -o typesense-mcp-server
Start the server by running the compiled binary:
./typesense-mcp-server
The server provides a typesense_search
tool to search documents in any Typesense collection.
collection
(required): Name of the Typesense collection to search inq
(required): Search query to find documentsquery_by
(optional): Comma-separated list of fields to search in (default: "*")filter_by
(optional): Filter expressions (e.g., "field:value", "num_field:>100")page
(required): Page number for pagination (1-based)per_page
(required): Number of results per page (default: 10, max: 100)To search for documents containing "laptop" in a "products" collection:
Tool: typesense_search
Parameters:
collection: products
q: laptop
query_by: name,description
filter_by: price:>100
page: 1
per_page: 20
This will return up to 20 results from the first page where the name or description contains "laptop" and the price is greater than 100.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.