thefaftek-git/mcp_notes_server
If you are the rightful owner of mcp_notes_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Notes Server is a FastAPI-based application designed to accept and store notes in a JSON file, leveraging the Model Context Protocol (MCP) for efficient data handling.
mcp_notes_server/ ├── app/ │ ├── main.py # FastAPI app │ ├── models.py # Pydantic Note model │ └── storage.py # JSON file storage logic ├── data/ │ └── notes.json # Notes storage (created at runtime) ├── tests/ │ └── test_notes.py # Test suite ├── requirements.txt ├── .gitignore └── README.md
MCP Notes Server
A Model Context Protocol (MCP) server for accepting and storing notes in a JSON file. Built with FastAPI and Python 3.10+.
Technology Stack
- Python 3.10+
- FastAPI (web framework)
- Uvicorn (ASGI server)
- Pydantic (data validation)
- pytest, httpx (testing)
Project Structure
mcp_notes_server/
├── app/
│ ├── main.py # FastAPI app
│ ├── models.py # Pydantic Note model
│ └── storage.py # JSON file storage logic
├── data/
│ └── notes.json # Notes storage (created at runtime)
├── tests/
│ └── test_notes.py # Test suite
├── requirements.txt
├── .gitignore
└── README.md
Setup & Installation
- Clone the repository
git clone <repo-url> cd mcp_notes_server - Create and activate a virtual environment
python3 -m venv venv source venv/bin/activate - Install dependencies
pip install -r requirements.txt
Configuration
- Notes Storage:
- By default, notes are stored in
data/notes.json. - To change the storage location, set the
NOTES_FILEenvironment variable:export NOTES_FILE=/path/to/your/notes.json
- By default, notes are stored in
- Directory Structure:
- All required folders are created automatically if missing.
- Port:
- Default server port is 8000. Change with
--port <number>when running uvicorn.
- Default server port is 8000. Change with
- Environment Variables:
NOTES_FILE(optional): Path to the notes JSON file.
Running the Server
From the project root (/home/nathan/plan1):
source mcp_notes_server/venv/bin/activate
PYTHONPATH=$(pwd)/mcp_notes_server uvicorn mcp_notes_server.app.main:app --reload --port 8000
- Access the API at: http://127.0.0.1:8000
- Interactive API docs: http://127.0.0.1:8000/docs
API Usage
POST /notes
- Request Body:
{ "text": "This is a note.", "timestamp": "2025-07-22T12:34:56Z", // optional "user_id": "user123" // optional } - Response:
201 Createdon success:{ "message": "Note saved successfully." }400/422for invalid input500for server errors
Example curl
curl -X POST http://127.0.0.1:8000/notes \
-H "Content-Type: application/json" \
-d '{"text": "Hello world!", "user_id": "alice"}'
Testing
Run all tests:
source venv/bin/activate
pytest
- Tests cover valid/invalid note submissions and file handling.
Troubleshooting
- ModuleNotFoundError: No module named 'app'
- Make sure to set
PYTHONPATHas shown above when running the server.
- Make sure to set
- Permission errors:
- Ensure the
data/directory is writable by the server process.
- Ensure the
- Dependencies missing:
- Run
pip install -r requirements.txtin your virtual environment.
- Run
- Port conflicts:
- Use
--port <number>to specify a different port.
- Use
Extending the Project
- Add endpoints for reading/searching notes.
- Implement authentication and authorization.
- Support multiple users or sessions.
- Add data backup and recovery features.
- Integrate with a conversational agent app.
- Use a database for scalability if needed.
License
MIT (or specify your own)