Papr Memory API integration for MCP (Model Context Protocol) servers
Project description
Papr MCP Server
A FastAPI-based MCP (Memory Control Protocol) server implementation for integrating with Papr's memory services (https://papr.ai).
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Prerequisites
- Python 3.10 or higher
- Get your API key: You can find it in the settings section of papr.ai. You'll need to create a developer account on Papr to get your API key.
Quick Start
- Clone this repository for Python MCP Papr Server:
git clone https://github.com/Papr-ai/papr_mcpserver
cd python-mcp
- Run the setup script:
# Try python3 first (recommended for cross-platform compatibility)
python3 setup_run_mcp.py
# If python3 is not found, use python instead
python setup_run_mcp.py
Note: If
python3command is not found on your system, usepythoninstead. This is common on Windows systems where Python 3 is installed as the defaultpythoncommand.
The setup script will guide you through the following steps:
-
Dependencies Installation
- Installs
uvif not already present - Creates a virtual environment (default '.venv')
- Installs all required project dependencies
- Installs
-
API Key Configuration
- Prompts for your Papr API key
- Validates the key format
- Stores it securely in
.envfile
-
MCP Client Selection
- Choose your preferred client:
- Claude
- Cursor AI
- Other
- Choose your preferred client:
-
Client Configuration
- For Claude: Automatically configures
claude_desktop_config.json - For Cursor AI: Automatically configures
./cursor/mcp.json - For Other clients: Displays the configuration JSON in console (you'll need to manually copy this to your client's configuration)
- For Claude: Automatically configures
Note: If you select "Other" as your client, the script will print the MCP configuration JSON to the console. You'll need to manually copy this configuration to your client's appropriate configuration file.
The script will then:
- Start the MCP server (optional)
Tip: You can always start the server later using the options described in the "Manual Server Start" section below.
Setup Options
You can run the setup script with different options:
# Full setup with all prompts
python3 setup_run_mcp.py # or python setup_run_mcp.py
# Skip dependency installation
python3 setup_run_mcp.py --skip-deps # or python setup_run_mcp.py --skip-deps
# Skip setup and run server
python3 setup_run_mcp.py --run-server # or python setup_run_mcp.py --run-server
Start Server Directly
If you chose not to start the server during setup, you can start it manually:
On macOS/Linux:
# Using uv directly
source .venv/bin/activate
uv run python paprmcp.py
# For debugging run and use mcp inspector as client
source .venv/bin/activate
fastmcp dev paprmcp.py
On Windows:
# Using uv directly
.venv\Scripts\activate
uv run python paprmcp.py
# For debugging run and use mcp inspector as client
.venv\Scripts\activate
fastmcp dev paprmcp.py
On Windows PowerShell:
# Using uv directly
.venv\Scripts\Activate.ps1
uv run python paprmcp.py
# For debugging run and use mcp inspector as client
.venv\Scripts\Activate.ps1
fastmcp dev paprmcp.py
Note: Using the setup script with --run-server is recommended as it ensures the correct virtual environment is used and proper configuration is loaded.
Created Configuration
The setup script creates two main configuration files:
-
.envfile in the project root:- Contains your Papr API key
- Sets the memory server URL (default is memory.papr.ai)
-
MCP configuration file (location depends on your OS and chosen client):
- macOS:
- Claude:
~/Library/Application Support/claude/claude_desktop_config.json - Cursor:
./cursor/mcp.json
- Claude:
- Windows:
- Claude:
%APPDATA%/claude/claude_desktop_config.json - Cursor:
./cursor/mcp.json
- Claude:
- Linux:
- Claude:
~/.config/claude/claude_desktop_config.json - Cursor:
./cursor/mcp.json
- Claude:
- macOS:
Development
The project uses pyproject.toml for dependency management with the following extras:
dev: Development tools (debugpy, Flask, etc.)test: Testing tools (pytest, coverage, etc.)all: All of the above
To install specific extras:
uv pip install ".[dev]" # Development dependencies
uv pip install ".[test]" # Testing dependencies
uv pip install ".[all]" # All dependencies
Debugging with VS Code
- Install debugpy:
uv pip install ".[dev]"
- For MCP Inspector (optional): Install Node.js to get npx:
# On Windows (using winget)
winget install OpenJS.NodeJS
# After installation, refresh PATH in PowerShell:
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User")
# Also ensure uv is properly installed and in PATH:
$env:PATH = "C:\Users\$env:USERNAME\.local\bin;$env:PATH"
# On macOS (using Homebrew)
brew install node
# On Linux (using package manager)
# Ubuntu/Debian:
sudo apt update && sudo apt install nodejs npm
# Or using NodeSource repository for latest version:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
- Start the server as well as mcp inspector in debug mode:
On macOS/Linux:
source .venv/bin/activate
python -m debugpy --wait-for-client --listen 5678 .venv/bin/fastmcp dev paprmcp.py
On Windows:
.venv\Scripts\activate
python -m debugpy --wait-for-client --listen 5678 .venv\Scripts\fastmcp.exe dev paprmcp.py
On Windows PowerShell:
.venv\Scripts\Activate.ps1
python -m debugpy --wait-for-client --listen 5678 .venv\Scripts\fastmcp.exe dev paprmcp.py
-
In VS Code:
- Go to Run and Debug view (Ctrl+Shift+D or Cmd+Shift+D)
- Select "Python: Attach to FastMCP"
- Click the green play button or press F5
- Set breakpoints in your code by clicking in the left margin
- The debugger will stop at breakpoints when the code is executed
-
Using MCP Inspector (alternative to VS Code debugging):
- After starting the server with
fastmcp dev paprmcp.py, you can use the MCP inspector - The inspector will automatically connect to your running MCP server
- This provides a web-based interface to test and interact with your MCP tools
- After starting the server with
Troubleshooting
If you encounter any issues:
-
Python command not found:
- If
python3is not found, try usingpythoninstead - Check your Python installation:
python --versionorpython3 --version - On Windows, Python 3 is often installed as
pythonrather thanpython3
- If
-
Windows-specific issues:
- PowerShell execution policy: If you get execution policy errors, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Virtual environment activation: Use
.venv\Scripts\activatein Command Prompt or.venv\Scripts\Activate.ps1in PowerShell - Path issues: Ensure
uvis in your PATH. It's typically installed to%USERPROFILE%\.cargo\binor%LOCALAPPDATA%\uv\bin
- PowerShell execution policy: If you get execution policy errors, run:
-
General issues:
- Check the logs for detailed error messages
- Ensure your Papr API key is correctly set in the
.envfile - Verify the virtual environment is activated
- Make sure all dependencies are installed correctly
For additional help, please contact support or open an issue in the repository.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file papr_memory_mcp-0.1.2.tar.gz.
File metadata
- Download URL: papr_memory_mcp-0.1.2.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
142660269b3bf05e2fee54d14bccb21d4283e4baf958ee33612b68f68bcf77f2
|
|
| MD5 |
18e9de85f0c873bc3699ef6cb6a671bb
|
|
| BLAKE2b-256 |
e080e998bbc98209b41a478079c82f4507682848efa3a8e1828b6366fce4365f
|
File details
Details for the file papr_memory_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: papr_memory_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
081ac6ab6e4f54109c59f7198576ef22ba2ac568fb7acc4447955648a64b1253
|
|
| MD5 |
75280988cc6f0d29186d09e8cd7e045b
|
|
| BLAKE2b-256 |
20237ce232c9b152b9992f28ab6b1818ce38f7e63864b28091a89006c60074c4
|