polypack-mcp
An MCP server that exposes Polypack as persistent adaptive memory. MCP-specific tools live here; the database remains an independent dependency.
Install and run
The simplest installation is from PyPI:
python3 -m pip install 'polypack-mcp[polypack]'
For one MCP client, use the default stdio server configuration. For Claude and Codex sharing the same durable memory, install once and create a long-running user service:
polypack-mcp setup --store ~/.local/share/polypack-mcp
This starts a Streamable HTTP server at http://127.0.0.1:8765/mcp, restarts it after a
failure, and prints client configuration snippets. The setup command uses
systemd --user; on systems without systemd, start the server directly:
polypack-mcp --transport streamable-http --port 8765 --store ~/.local/share/polypack-mcp
In shared Streamable HTTP mode, configure both clients with the URL. Do not configure them
with a command and --store, since that starts two processes competing for
the same durable store.
Codex (~/.codex/config.toml):
[mcp_servers.polypack]
url = "http://127.0.0.1:8765/mcp"
Claude Desktop:
{
"mcpServers": {
"polypack": { "url": "http://127.0.0.1:8765/mcp" }
}
}
Debian package
The Debian package installs and starts a system-level polypack-mcp service
automatically. It runs as the dedicated polypack user, stores data in
/var/lib/polypack-mcp, and exposes the same local Streamable HTTP endpoint:
sudo apt install ./polypack-mcp_<version>_amd64.deb
After installation, point Claude and Codex at
http://127.0.0.1:8765/mcp. The default port can be changed in
/etc/default/polypack-mcp, followed by a service restart. The service can be
managed with:
sudo systemctl status polypack-mcp
sudo systemctl restart polypack-mcp
The PyPI installation remains user-managed and uses polypack-mcp setup to
create a per-user service instead.
RPM package
RPM-based distributions can install the matching .rpm asset from the
GitHub release:
sudo dnf install ./polypack-mcp-<version>-1.x86_64.rpm
The RPM package provides the same systemd service, store location, localhost Streamable HTTP endpoint, and Python 3.12 requirement as the Debian package.
Run manually
pip install -e '.[polypack]'
polypack-mcp --store ./polypack-data
The server exposes eight focused tools: memory_store, memory_recall,
memory_context, memory_feedback, memory_suppress, memory_supersede,
memory_consolidate, and graph_query. It also publishes context, active-memory,
schema, and stats resources under polypack://.
Memory classes are entity, episodic, procedural, and semantic. Store
project or user preferences as procedural memories; preference is not a
separate memory class.
When using a durable Polypack store, mutating operations checkpoint immediately and the server flushes the store during shutdown.
Retrieval tools return {items, metadata}. Metadata includes candidate and
excluded counts, context matches, score components, fallback behavior, the
retrieval version, and selection statistics. memory_context uses estimated
tokens (ceil(content characters / 4), minimum one) as its token_budget.
An item is never returned if it would exceed the remaining budget; budgets less
than or equal to zero are rejected. Context is a soft preference: matching
memories are preferred and unscoped global memories may be used as fallback.
Pass strict_context: true for isolation. An empty isolated result reports
reason: "no_context_match" and the searched context.
Feedback is activation feedback: useful=true reinforces a memory and
useful=false provides negative retrieval feedback. Responses expose activation
before and after plus whether learned weights changed. Supersession and
consolidation materialize SUPERSEDES, SUPERSEDED_BY, and
CONSOLIDATED_FROM graph edges.
Pass --store to open a durable Polypack directory. Without it, the server uses
the in-memory reference backend, which is convenient for smoke tests.
The polypack extra requires polypack-db>=3.3.1 and uses its native
ActivationEngine.working_memory selector for context assembly.
Development
pip install -e '.[dev]'
pytest
The test suite includes an MCP client/server protocol smoke test covering tool discovery, memory storage, recall, and resource reads.
Documentation
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 polypack_mcp-0.1.8.tar.gz.
File metadata
- Download URL: polypack_mcp-0.1.8.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1397a73d841b83b0b874afba1e201d3089afae93070329126d41ae250c96e43b
|
|
| MD5 |
c15f4b1a15df658f83f0c33e17cc9337
|
|
| BLAKE2b-256 |
072474a833b1d6bfe987f0ad7a4bfc8d085d74c3daf4ef93d631ac6e91d5cea6
|
Provenance
The following attestation bundles were made for polypack_mcp-0.1.8.tar.gz:
Publisher:
release.yml on imattau/polypack-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polypack_mcp-0.1.8.tar.gz -
Subject digest:
1397a73d841b83b0b874afba1e201d3089afae93070329126d41ae250c96e43b - Sigstore transparency entry: 2568840906
- Sigstore integration time:
-
Permalink:
imattau/polypack-mcp@c6f0cc70a83fbc1960d9832edaff70b384495ddf -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/imattau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6f0cc70a83fbc1960d9832edaff70b384495ddf -
Trigger Event:
push
-
Statement type:
File details
Details for the file polypack_mcp-0.1.8-py3-none-any.whl.
File metadata
- Download URL: polypack_mcp-0.1.8-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0938e28f46a648d95a129e4c98409750b37de67708abce41eeb9cf9f400525a6
|
|
| MD5 |
9d39c764f32c1dd3b42cbb2a8740b65c
|
|
| BLAKE2b-256 |
e4c9242abe23ca08b8cc2b788f0d3926d6ed563e276dbbeabba178f528418637
|
Provenance
The following attestation bundles were made for polypack_mcp-0.1.8-py3-none-any.whl:
Publisher:
release.yml on imattau/polypack-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polypack_mcp-0.1.8-py3-none-any.whl -
Subject digest:
0938e28f46a648d95a129e4c98409750b37de67708abce41eeb9cf9f400525a6 - Sigstore transparency entry: 2568840918
- Sigstore integration time:
-
Permalink:
imattau/polypack-mcp@c6f0cc70a83fbc1960d9832edaff70b384495ddf -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/imattau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6f0cc70a83fbc1960d9832edaff70b384495ddf -
Trigger Event:
push
-
Statement type: