Sponsored by Deepsite.site

The Pensieve MCP Server

Created By
seanivore9 months ago
One simply siphons the excess thoughts from one's mind, pours them into the basin, and examines them at one's leisure. It becomes easier to spot patterns and links, you understand, when they are in this form.
Content

The Pensieve MCP Server

One simply siphons the excess thoughts from one's mind, pours them into the basin, and examines them at one's leisure. It becomes easier to spot patterns and links, you understand, when they are in this form.

This is a TypeScript-based MCP server that implements a RAG-based knowledge management system. It demonstrates core MCP concepts by providing:

  • Resources representing stored knowledge with URIs and metadata
  • Natural language interface for querying knowledge
  • LLM-powered analysis and response synthesis

Features

Resources

  • Access knowledge via memory:// URIs
  • Markdown files containing structured knowledge
  • Metadata for categorization and retrieval

Tools

  • ask_pensieve - Query your stored knowledge
    • Takes natural language questions
    • Uses LLM to analyze and retrieve relevant information
    • Provides contextual answers based on stored knowledge

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Knowledge Organization

Store your knowledge as markdown files in the root directory:

  1. Use clear categories in filenames (e.g., skills-javascript.md)
  2. One topic per file
  3. Include relevant metadata (dates, sources, etc.)
  4. Use clear, well-structured content

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "The Pensieve": {
      "command": "/path/to/The Pensieve/build/index.js"
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

async function handleQuestion(question: string) { // 1. Analyze question const analysis = await server.request(SamplingCreateMessageRequestSchema, { messages: [{ role: "user", content: { type: "text", text: question } }], systemPrompt: "You are the Pensieve. Analyze questions to determine what knowledge to retrieve.", includeContext: "none" });

// 2. Use existing RAG query (from our working code) const results = await ragPipeline.semanticSearch(analysis.content.text);

// 3. Compose response const response = await server.request(SamplingCreateMessageRequestSchema, { messages: [{ role: "user", content: { type: "text", text: Answer using this knowledge: ${results.map(r => r.payload.full_text).join('\n')} } }], systemPrompt: "You are the Pensieve. Provide clear answers based on stored knowledge.", includeContext: "none" });

return response.content.text; }

const documentGuide = `To prepare documents for the Pensieve:

  1. Place files in the root directory
  2. Use clear categories in filenames (e.g., skills-javascript.md)
  3. One topic per file
  4. Clear, well-structured content
  5. Include relevant metadata (dates, sources, etc.)`;

{ uri: "memory://knowledge/skills-javascript.md", mimeType: "text/markdown", // Since we're using markdown files name: "JavaScript Skills", description: "Knowledge about JavaScript development" }

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code