Slite MCP Server
raw JSON → 1.3.0 verified Sat Apr 25 auth: no javascript
A Model Context Protocol server that integrates Slite's knowledge management capabilities with AI models supporting function calling through MCP. Version 1.3.0 enables AI assistants to search notes, ask questions, retrieve note details, and create notes via tools like search-notes, ask-slite, get-note, get-note-children, and create-note. Unlike direct API integration, MCP provides a standardized protocol for tool discovery and invocation. The package ships TypeScript types and is designed for use with MCP-compatible AI clients (e.g., Claude). Features include optional filtering, pagination, content formatting, and environment variable configuration.
Common errors
error Error: Missing required parameter: apiKey ↓
cause The SLITE_API_KEY environment variable is not set and no --api-key argument was provided.
fix
export SLITE_API_KEY=your_key_here or pass --api-key=your_key_here when running npx.
error TypeError: Cannot read properties of undefined (reading 'callTool') ↓
cause Calling server.callTool before server.start() has completed (common async mistake).
fix
Ensure await server.start() is called before any tool invocation.
error ValidationError: Either markdown or html must be provided ↓
cause Both markdown and html were omitted in a create-note call.
fix
Provide either markdown (string) or html (string) parameter when calling create-note.
Warnings
breaking API key is required: either pass via --api-key CLI argument or set SLITE_API_KEY environment variable. Missing key causes immediate runtime error. ↓
fix Ensure SLITE_API_KEY is set in environment or provided via CLI option.
gotcha The create-note tool requires either markdown or html parameter; both cannot be omitted. Mistake leads to validation error. ↓
fix Always provide at least one of markdown or html when calling create-note.
gotcha Search results pagination: page and hitsPerPage are optional but if omitted, defaults may lead to incomplete results. ↓
fix Specify page and hitsPerPage explicitly to control pagination.
Install
npm install slite-mcp-server yarn add slite-mcp-server pnpm add slite-mcp-server Imports
- SliteMcpServer wrong
const SliteMcpServer = require('slite-mcp-server')correctimport { SliteMcpServer } from 'slite-mcp-server' - runServer wrong
import runServer from 'slite-mcp-server'correctimport { runServer } from 'slite-mcp-server'
Quickstart
import { SliteMcpServer } from 'slite-mcp-server';
const server = new SliteMcpServer({
apiKey: process.env.SLITE_API_KEY ?? ''
});
await server.start();
// The server exposes tools: search-notes, ask-slite, get-note, get-note-children, create-note
// Use an MCP client to invoke them.
// Example: searching notes
const searchResult = await server.callTool('search-notes', {
query: 'MCP integration',
page: 1,
hitsPerPage: 10
});
console.log(searchResult);