This project implements a Model Context Protocol (MCP) server that provides tools for managing a knowledge base through API interactions. It allows AI assistants to create, update, and search notes in your knowledge base.
The Knowledge Base MCP Server provides the following functionality:
- Add new notes with titles, content, and tags
- Update existing notes
- Find note IDs by searching for keywords in titles or content
This server acts as a bridge between AI assistants and your knowledge base API, enabling structured interaction with your notes database.
- Node.js (v14 or higher recommended)
- npm or yarn
- A running API server at
http://localhost:3000that provides note management functionality
- Clone this repository
- Install dependencies:
or
npm install
yarn install
This project relies on the following packages:
@modelcontextprotocol/sdk- The Model Context Protocol SDKaxios- For making HTTP requests to the knowledge base APIzod- For schema validation
Build the server with
npm run buildStart the server with:
node index.jsThe server will run on stdio, allowing it to communicate with clients that implement the MCP client protocol.
Testing Your Server To test your MCP server with Claude for Desktop:
Follow the guide from Anthropic at: Testing Your Server with Claude for Desktop
This guide will walk you through the process of connecting your MCP server to Claude and verifying that the tools are working correctly.
Creates a new note in the knowledge base.
Parameters:
title(string): Title of the notecontent(string): Content of the notetags(array): Array of tag objects withid,name, andcolorproperties
Updates an existing note in the knowledge base.
Parameters:
id(string): The ID of the note to updatetitle(string, optional): New title for the notecontent(string, optional): New content for the notetags(array, optional): New tags for the note
Searches for notes containing a specific keyword in their title or content.
Parameters:
keyword(string): A keyword to search for in note titles or content
This server expects a knowledge base API running at http://localhost:3000 with the following endpoints:
POST /api/notes- Create a new notePUT /api/notes/:id- Update an existing noteGET /api/notes- Get all notes
A note in the knowledge base has the following structure:
interface Note {
id: string;
title: string;
content: string;
tags: Array<{
id: string;
name: string;
color: string;
notesCount?: number;
}>;
updatedAt: string;
}The server includes error handling for API requests. If an error occurs, it will be logged to the console and returned in the tool response.
[Your License Here]
[Your Contribution Guidelines Here]