Skip to main content
Glama
Abhijeet103

notes-mcp-server

by Abhijeet103

FastAPI + MCP + LangGraph Demo

This is a very small learning project.

One app exposes the same note operations in two ways:

  • REST API with FastAPI

  • MCP tools for AI clients and agents

What is included

  • POST /notes to create a note

  • GET /notes/{note_id} to read a note

  • GET /graph-rag?question=... for a tiny Graph RAG example

  • MCP tools:

    • create_note

    • get_note

    • graph_rag_search

  • mcp_client_demo.py to call the MCP server directly

  • langgraph_agent_demo.py to give a LangGraph agent access to the MCP tools

  • graph_rag_demo.py to show a tiny knowledge-graph retrieval flow

Related MCP server: approveit MCP Server

Install

.venv/bin/pip install -e .

Run the server

.venv/bin/uvicorn main:app --reload

Open:

  • FastAPI docs: http://127.0.0.1:8000/docs

  • MCP endpoint: http://127.0.0.1:8000/mcp/

Try the REST API

Create:

curl -X POST http://127.0.0.1:8000/notes \
  -H "content-type: application/json" \
  -d '{"title":"hello","content":"from fastapi"}'

Read:

curl http://127.0.0.1:8000/notes/1

Try the MCP client

Start the server first, then run:

.venv/bin/python mcp_client_demo.py

Try the Graph RAG demo

Run the standalone script:

.venv/bin/python graph_rag_demo.py

Or hit the REST endpoint:

curl "http://127.0.0.1:8000/graph-rag?question=How%20is%20Bob%20connected%20to%20Neo4j%3F"

What the Graph RAG demo is showing

This part is intentionally tiny and concept-focused:

  • a few short source documents

  • a few graph triples like Bob -> owns -> Search API

  • retrieval over graph structure instead of only plain text matching

The most important concept is multi-hop retrieval. For example:

  • Bob -> owns -> Search API

  • Search API -> depends_on -> Graph RAG Service

  • Graph RAG Service -> uses -> Neo4j

That lets the demo answer a question like How is Bob connected to Neo4j? by walking the graph path.

Try the LangGraph agent

Start the server first, then set your OpenAI key:

export OPENAI_API_KEY=your_key_here

Optional model override:

export OPENAI_MODEL=gpt-4.1-mini

Run the demo:

.venv/bin/python langgraph_agent_demo.py

Without OPENAI_API_KEY, the script will still show that LangGraph can load the MCP tools, but it will skip the actual agent run.

Notes

  • Data is stored only in memory.

  • Restarting the server clears all notes.

  • This is intentionally minimal for learning.

Related MCP Connectors

Related MCP Servers

  • -
    license
    C
    quality
    D
    maintenance
    Enables creating and managing text notes through MCP resources and tools. Provides note creation capabilities and automatic summarization of all stored notes.
    1
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A simple notes system that allows creating, storing, and accessing text notes through MCP resources and tools, with built-in prompt support for generating summaries of stored notes.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables access to a notes knowledge base via MCP, providing tools for keyword search, note creation, and retrieval, along with browseable note resources.
    8 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to manage in-memory notes by listing, fetching, and creating notes through MCP tools over stdio.
    32 npm
    MIT