getme-mcp-server 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- getme_mcp_server-1.0.1/.gitignore +155 -0
- getme_mcp_server-1.0.1/Dockerfile +28 -0
- getme_mcp_server-1.0.1/PKG-INFO +144 -0
- getme_mcp_server-1.0.1/README.md +135 -0
- getme_mcp_server-1.0.1/docker-compose.yml +19 -0
- getme_mcp_server-1.0.1/getme_mcp_server/__init__.py +4 -0
- getme_mcp_server-1.0.1/getme_mcp_server/__main__.py +36 -0
- getme_mcp_server-1.0.1/getme_mcp_server/_version.py +24 -0
- getme_mcp_server-1.0.1/getme_mcp_server/client.py +211 -0
- getme_mcp_server-1.0.1/getme_mcp_server/config.py +43 -0
- getme_mcp_server-1.0.1/getme_mcp_server/server.py +86 -0
- getme_mcp_server-1.0.1/getme_mcp_server/utills.py +26 -0
- getme_mcp_server-1.0.1/pyproject.toml +54 -0
- getme_mcp_server-1.0.1/server.json +51 -0
- getme_mcp_server-1.0.1/server.tmp +51 -0
- getme_mcp_server-1.0.1/tests/test_client.py +151 -0
- getme_mcp_server-1.0.1/tests/test_validation.py +42 -0
- getme_mcp_server-1.0.1/uv.lock +1211 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
|
|
2
|
+
# ---- Python (.gitignore) ----
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
.python-version
|
|
87
|
+
|
|
88
|
+
# pipenv
|
|
89
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
90
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
91
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
92
|
+
# install all needed dependencies.
|
|
93
|
+
Pipfile.lock
|
|
94
|
+
|
|
95
|
+
# Poetry
|
|
96
|
+
# poetry.lock is generally recommended to commit.
|
|
97
|
+
poetry.lock
|
|
98
|
+
|
|
99
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
100
|
+
__pypackages__/
|
|
101
|
+
|
|
102
|
+
# Celery stuff
|
|
103
|
+
celerybeat-schedule
|
|
104
|
+
celerybeat.pid
|
|
105
|
+
|
|
106
|
+
# SageMath parsed files
|
|
107
|
+
*.sage.py
|
|
108
|
+
|
|
109
|
+
# Environments
|
|
110
|
+
.env
|
|
111
|
+
.venv
|
|
112
|
+
env/
|
|
113
|
+
venv/
|
|
114
|
+
ENV/
|
|
115
|
+
env.bak/
|
|
116
|
+
venv.bak/
|
|
117
|
+
|
|
118
|
+
# Spyder project settings
|
|
119
|
+
.spyderproject
|
|
120
|
+
.spyproject
|
|
121
|
+
|
|
122
|
+
# Rope project settings
|
|
123
|
+
.ropeproject
|
|
124
|
+
|
|
125
|
+
# mkdocs documentation
|
|
126
|
+
/site
|
|
127
|
+
|
|
128
|
+
# mypy
|
|
129
|
+
.mypy_cache/
|
|
130
|
+
.dmypy.json
|
|
131
|
+
dmypy.json
|
|
132
|
+
|
|
133
|
+
# Pyre type checker
|
|
134
|
+
.pyre/
|
|
135
|
+
|
|
136
|
+
# pytype
|
|
137
|
+
.pytype/
|
|
138
|
+
|
|
139
|
+
# Cython debug symbols
|
|
140
|
+
cython_debug/
|
|
141
|
+
|
|
142
|
+
# Ruff
|
|
143
|
+
.ruff_cache/
|
|
144
|
+
|
|
145
|
+
# PDM
|
|
146
|
+
.pdm.toml
|
|
147
|
+
.pdm-python
|
|
148
|
+
.pdm-build/
|
|
149
|
+
|
|
150
|
+
# IDE / editor caches (Python-related)
|
|
151
|
+
.vscode/.ropeproject
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# hatch-vcs dynamic version file
|
|
155
|
+
getme_mcp_server/_version.py
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm AS builder
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
COPY pyproject.toml uv.lock README.md ./
|
|
6
|
+
|
|
7
|
+
RUN uv sync --frozen --no-dev
|
|
8
|
+
|
|
9
|
+
COPY getme_mcp_server ./getme_mcp_server
|
|
10
|
+
|
|
11
|
+
RUN uv pip install --python /app/.venv/bin/python --no-deps .
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# slim Python image, no uv
|
|
15
|
+
FROM python:3.12-slim-bookworm AS runtime
|
|
16
|
+
|
|
17
|
+
WORKDIR /app
|
|
18
|
+
|
|
19
|
+
ENV PYTHONUNBUFFERED=1 \
|
|
20
|
+
GETME_BASE_URL=http://unix \
|
|
21
|
+
GETME_SOCKET_PATH=/tmp/getMeStore/sockDir/getMe.sock \
|
|
22
|
+
PATH=/app/.venv/bin:$PATH
|
|
23
|
+
|
|
24
|
+
COPY --from=builder /app/.venv /app/.venv
|
|
25
|
+
|
|
26
|
+
COPY --from=builder /app/README.md /app/README.md
|
|
27
|
+
|
|
28
|
+
ENTRYPOINT ["getme-mcp-server"]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: getme-mcp-server
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: MCP server for getMe (HTTP over Unix domain socket).
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Requires-Dist: httpx>=0.27.0
|
|
7
|
+
Requires-Dist: mcp>=1.0.0
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# getMe MCP Server
|
|
11
|
+
|
|
12
|
+
An MCP server that exposes `getMe` key-value operations as Model Context Protocol (MCP) tools, enabling LLMs to talk to the getMe core database over **HTTP via a Unix Domain Socket (UDS)**.
|
|
13
|
+
|
|
14
|
+
<!-- mcp-name: io.github.aatirnadim/getme-mcp-server -->
|
|
15
|
+
|
|
16
|
+
## 🔗 Quick Links
|
|
17
|
+
|
|
18
|
+
- **GitHub Repository**: [AatirNadim/getMe](https://github.com/AatirNadim/getMe)
|
|
19
|
+
- **PyPI Package**: [getme-mcp-server](https://pypi.org/project/getme-mcp-server/)
|
|
20
|
+
- **Core Database Docs**: [Architecture & Deep Dive](https://github.com/AatirNadim/getMe/tree/main/server)
|
|
21
|
+
- **DockerHub Image**: [getme](https://hub.docker.com/r/aatir0docking/getme)
|
|
22
|
+
- **Blog Part I - Building getMe**: [Read here!](https://techtom.hashnode.dev/building-getme-i)
|
|
23
|
+
- **Blog Part II - Building getMe**: [Read here!](https://techtom.hashnode.dev/building-getme-ii)
|
|
24
|
+
|
|
25
|
+
## Using the MCP Server
|
|
26
|
+
|
|
27
|
+
The `getme-mcp-server` package is published on PyPI. For integration with MCP-compatible clients like Claude Desktop, Cursor, or the MCP Inspector, you can seamlessly run it using `uvx` or `pipx`.
|
|
28
|
+
|
|
29
|
+
### Claude Desktop Configuration
|
|
30
|
+
|
|
31
|
+
Add the following to your `claude_desktop_config.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"getme": {
|
|
37
|
+
"command": "uvx",
|
|
38
|
+
"args": ["getme-mcp-server"],
|
|
39
|
+
"env": {
|
|
40
|
+
"GETME_SOCKET_PATH": "/tmp/getMeStore/sockDir/getMe.sock",
|
|
41
|
+
"GETME_KEY_PREFIX": "agent-context:",
|
|
42
|
+
"GETME_READ_ONLY": "false"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Features & Safety
|
|
50
|
+
|
|
51
|
+
- **Read-Only Mode:** Ensure LLMs don't mutate data via `GETME_READ_ONLY=true`.
|
|
52
|
+
- **Destructive Operation Guards:** The `clear` tool is disabled by default, ensuring agents can't accidentally drop the store.
|
|
53
|
+
- **Payload & Connection Limits:** Defends against massive payloads/batches and re-uses HTTP connections for performance.
|
|
54
|
+
- **Prefix Isolation:** Restrict the LLM to a specific namespace in the DB with `GETME_KEY_PREFIX`.
|
|
55
|
+
- **Masked Logging:** Tool execution metadata is logged, but payloads are masked to prevent leaking secrets.
|
|
56
|
+
|
|
57
|
+
## Configuration (Environment Variables)
|
|
58
|
+
|
|
59
|
+
Control safety rules and performance via environment variables.
|
|
60
|
+
|
|
61
|
+
- `GETME_SOCKET_PATH` (default: `/tmp/getMeStore/sockDir/getMe.sock`): Path to the UNIX socket used by the core getMe daemon.
|
|
62
|
+
- `GETME_READ_ONLY` (default: `false`): If `true`, only `get` and `get_json` tools are registered.
|
|
63
|
+
- `GETME_ALLOW_CLEAR` (default: `false`): If `true`, enables the dangerous `clear` tool.
|
|
64
|
+
- `GETME_KEY_PREFIX` (default: `""`): String prefix prepended to all keys. Sandboxes the LLM (e.g., `agent1:`).
|
|
65
|
+
- `GETME_MAX_VALUE_SIZE_BYTES` (default: `5242880` / 5MB): Limit on single value payload sizes.
|
|
66
|
+
- `GETME_MAX_BATCH_ITEMS` (default: `100`): Maximum keys processed in one `batch_put`.
|
|
67
|
+
|
|
68
|
+
## Best Practices
|
|
69
|
+
|
|
70
|
+
1. **Sandbox with Prefixes**: Always use `GETME_KEY_PREFIX` when handing the database over to an LLM. For instance, using `GETME_KEY_PREFIX="claude:"` ensures the model can't overwrite core application data.
|
|
71
|
+
2. **Restrict Privileges**: If the agent only needs context (e.g., fetching RAG documents or reading app state), enforce `GETME_READ_ONLY=true`.
|
|
72
|
+
3. **Never Allow Clear**: Keep `GETME_ALLOW_CLEAR=false` (the default) in production environments to prevent catastrophic drops caused by hallucinated commands.
|
|
73
|
+
4. **Volume Mounts**: Make sure the environment running the MCP server has adequate read/write permissions to the `GETME_SOCKET_PATH`.
|
|
74
|
+
|
|
75
|
+
## Tools
|
|
76
|
+
|
|
77
|
+
Once connected, the LLM has access to the following operations:
|
|
78
|
+
|
|
79
|
+
- `get(key) -> str`
|
|
80
|
+
- `get_json(key) -> object`
|
|
81
|
+
- `put(key, value) -> str`
|
|
82
|
+
- `put_json(key, json_value) -> str`
|
|
83
|
+
- `delete(key) -> str`
|
|
84
|
+
- `clear() -> str` _(Requires `GETME_ALLOW_CLEAR=true`)_
|
|
85
|
+
- `batch_put(pairs: object) -> object`
|
|
86
|
+
- `batch_get(keys: list) -> object`
|
|
87
|
+
- `batch_delete(keys: list) -> object`
|
|
88
|
+
|
|
89
|
+
## Development & Installation
|
|
90
|
+
|
|
91
|
+
### Prereqs
|
|
92
|
+
|
|
93
|
+
- `uv` installed
|
|
94
|
+
- `getMe` core server running and listening on the Unix socket
|
|
95
|
+
|
|
96
|
+
### Install from Source
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
cd mcp-server
|
|
100
|
+
uv sync
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Fixing VS Code "package not installed" warnings
|
|
104
|
+
|
|
105
|
+
If Pylance shows warnings like `Package "httpx" is not installed in the selected environment`, VS Code is using a different Python interpreter than the `uv` virtualenv.
|
|
106
|
+
|
|
107
|
+
- Open Command Palette → `Python: Select Interpreter`
|
|
108
|
+
- Select: `getMe/mcp-server/.venv/bin/python`
|
|
109
|
+
|
|
110
|
+
This repo also includes a workspace setting that points the interpreter at `mcp-server/.venv`.
|
|
111
|
+
|
|
112
|
+
### Run Locally
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cd mcp-server
|
|
116
|
+
# optional override
|
|
117
|
+
export GETME_SOCKET_PATH=/tmp/getMeStore/sockDir/getMe.sock
|
|
118
|
+
uv run getme-mcp-server
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Docker deployment
|
|
122
|
+
|
|
123
|
+
This MCP server speaks **stdio** (JSON-RPC), so when running in Docker you must avoid allocating a TTY.
|
|
124
|
+
|
|
125
|
+
Build the image:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cd mcp-server
|
|
129
|
+
docker compose build
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Run it over stdio (recommended for MCP clients):
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cd mcp-server
|
|
136
|
+
docker compose run --rm -T getme-mcp-server
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The compose file bind-mounts the host UDS directory:
|
|
140
|
+
|
|
141
|
+
- host: `/tmp/getMeStore/sockDir`
|
|
142
|
+
- container: `/tmp/getMeStore/sockDir`
|
|
143
|
+
|
|
144
|
+
So the MCP server can reach the core getMe server via `GETME_SOCKET_PATH=/tmp/getMeStore/sockDir/getMe.sock`.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# getMe MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP server that exposes `getMe` key-value operations as Model Context Protocol (MCP) tools, enabling LLMs to talk to the getMe core database over **HTTP via a Unix Domain Socket (UDS)**.
|
|
4
|
+
|
|
5
|
+
<!-- mcp-name: io.github.aatirnadim/getme-mcp-server -->
|
|
6
|
+
|
|
7
|
+
## 🔗 Quick Links
|
|
8
|
+
|
|
9
|
+
- **GitHub Repository**: [AatirNadim/getMe](https://github.com/AatirNadim/getMe)
|
|
10
|
+
- **PyPI Package**: [getme-mcp-server](https://pypi.org/project/getme-mcp-server/)
|
|
11
|
+
- **Core Database Docs**: [Architecture & Deep Dive](https://github.com/AatirNadim/getMe/tree/main/server)
|
|
12
|
+
- **DockerHub Image**: [getme](https://hub.docker.com/r/aatir0docking/getme)
|
|
13
|
+
- **Blog Part I - Building getMe**: [Read here!](https://techtom.hashnode.dev/building-getme-i)
|
|
14
|
+
- **Blog Part II - Building getMe**: [Read here!](https://techtom.hashnode.dev/building-getme-ii)
|
|
15
|
+
|
|
16
|
+
## Using the MCP Server
|
|
17
|
+
|
|
18
|
+
The `getme-mcp-server` package is published on PyPI. For integration with MCP-compatible clients like Claude Desktop, Cursor, or the MCP Inspector, you can seamlessly run it using `uvx` or `pipx`.
|
|
19
|
+
|
|
20
|
+
### Claude Desktop Configuration
|
|
21
|
+
|
|
22
|
+
Add the following to your `claude_desktop_config.json`:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"getme": {
|
|
28
|
+
"command": "uvx",
|
|
29
|
+
"args": ["getme-mcp-server"],
|
|
30
|
+
"env": {
|
|
31
|
+
"GETME_SOCKET_PATH": "/tmp/getMeStore/sockDir/getMe.sock",
|
|
32
|
+
"GETME_KEY_PREFIX": "agent-context:",
|
|
33
|
+
"GETME_READ_ONLY": "false"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Features & Safety
|
|
41
|
+
|
|
42
|
+
- **Read-Only Mode:** Ensure LLMs don't mutate data via `GETME_READ_ONLY=true`.
|
|
43
|
+
- **Destructive Operation Guards:** The `clear` tool is disabled by default, ensuring agents can't accidentally drop the store.
|
|
44
|
+
- **Payload & Connection Limits:** Defends against massive payloads/batches and re-uses HTTP connections for performance.
|
|
45
|
+
- **Prefix Isolation:** Restrict the LLM to a specific namespace in the DB with `GETME_KEY_PREFIX`.
|
|
46
|
+
- **Masked Logging:** Tool execution metadata is logged, but payloads are masked to prevent leaking secrets.
|
|
47
|
+
|
|
48
|
+
## Configuration (Environment Variables)
|
|
49
|
+
|
|
50
|
+
Control safety rules and performance via environment variables.
|
|
51
|
+
|
|
52
|
+
- `GETME_SOCKET_PATH` (default: `/tmp/getMeStore/sockDir/getMe.sock`): Path to the UNIX socket used by the core getMe daemon.
|
|
53
|
+
- `GETME_READ_ONLY` (default: `false`): If `true`, only `get` and `get_json` tools are registered.
|
|
54
|
+
- `GETME_ALLOW_CLEAR` (default: `false`): If `true`, enables the dangerous `clear` tool.
|
|
55
|
+
- `GETME_KEY_PREFIX` (default: `""`): String prefix prepended to all keys. Sandboxes the LLM (e.g., `agent1:`).
|
|
56
|
+
- `GETME_MAX_VALUE_SIZE_BYTES` (default: `5242880` / 5MB): Limit on single value payload sizes.
|
|
57
|
+
- `GETME_MAX_BATCH_ITEMS` (default: `100`): Maximum keys processed in one `batch_put`.
|
|
58
|
+
|
|
59
|
+
## Best Practices
|
|
60
|
+
|
|
61
|
+
1. **Sandbox with Prefixes**: Always use `GETME_KEY_PREFIX` when handing the database over to an LLM. For instance, using `GETME_KEY_PREFIX="claude:"` ensures the model can't overwrite core application data.
|
|
62
|
+
2. **Restrict Privileges**: If the agent only needs context (e.g., fetching RAG documents or reading app state), enforce `GETME_READ_ONLY=true`.
|
|
63
|
+
3. **Never Allow Clear**: Keep `GETME_ALLOW_CLEAR=false` (the default) in production environments to prevent catastrophic drops caused by hallucinated commands.
|
|
64
|
+
4. **Volume Mounts**: Make sure the environment running the MCP server has adequate read/write permissions to the `GETME_SOCKET_PATH`.
|
|
65
|
+
|
|
66
|
+
## Tools
|
|
67
|
+
|
|
68
|
+
Once connected, the LLM has access to the following operations:
|
|
69
|
+
|
|
70
|
+
- `get(key) -> str`
|
|
71
|
+
- `get_json(key) -> object`
|
|
72
|
+
- `put(key, value) -> str`
|
|
73
|
+
- `put_json(key, json_value) -> str`
|
|
74
|
+
- `delete(key) -> str`
|
|
75
|
+
- `clear() -> str` _(Requires `GETME_ALLOW_CLEAR=true`)_
|
|
76
|
+
- `batch_put(pairs: object) -> object`
|
|
77
|
+
- `batch_get(keys: list) -> object`
|
|
78
|
+
- `batch_delete(keys: list) -> object`
|
|
79
|
+
|
|
80
|
+
## Development & Installation
|
|
81
|
+
|
|
82
|
+
### Prereqs
|
|
83
|
+
|
|
84
|
+
- `uv` installed
|
|
85
|
+
- `getMe` core server running and listening on the Unix socket
|
|
86
|
+
|
|
87
|
+
### Install from Source
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cd mcp-server
|
|
91
|
+
uv sync
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Fixing VS Code "package not installed" warnings
|
|
95
|
+
|
|
96
|
+
If Pylance shows warnings like `Package "httpx" is not installed in the selected environment`, VS Code is using a different Python interpreter than the `uv` virtualenv.
|
|
97
|
+
|
|
98
|
+
- Open Command Palette → `Python: Select Interpreter`
|
|
99
|
+
- Select: `getMe/mcp-server/.venv/bin/python`
|
|
100
|
+
|
|
101
|
+
This repo also includes a workspace setting that points the interpreter at `mcp-server/.venv`.
|
|
102
|
+
|
|
103
|
+
### Run Locally
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
cd mcp-server
|
|
107
|
+
# optional override
|
|
108
|
+
export GETME_SOCKET_PATH=/tmp/getMeStore/sockDir/getMe.sock
|
|
109
|
+
uv run getme-mcp-server
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Docker deployment
|
|
113
|
+
|
|
114
|
+
This MCP server speaks **stdio** (JSON-RPC), so when running in Docker you must avoid allocating a TTY.
|
|
115
|
+
|
|
116
|
+
Build the image:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cd mcp-server
|
|
120
|
+
docker compose build
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Run it over stdio (recommended for MCP clients):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd mcp-server
|
|
127
|
+
docker compose run --rm -T getme-mcp-server
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The compose file bind-mounts the host UDS directory:
|
|
131
|
+
|
|
132
|
+
- host: `/tmp/getMeStore/sockDir`
|
|
133
|
+
- container: `/tmp/getMeStore/sockDir`
|
|
134
|
+
|
|
135
|
+
So the MCP server can reach the core getMe server via `GETME_SOCKET_PATH=/tmp/getMeStore/sockDir/getMe.sock`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
services:
|
|
2
|
+
getme-mcp-server:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: Dockerfile
|
|
6
|
+
image: getme-mcp-server:local
|
|
7
|
+
|
|
8
|
+
# the getMe core server over UDS (HTTP over Unix domain socket).
|
|
9
|
+
volumes:
|
|
10
|
+
- /tmp/getMeStore/sockDir:/tmp/getMeStore/sockDir
|
|
11
|
+
|
|
12
|
+
environment:
|
|
13
|
+
GETME_SOCKET_PATH: /tmp/getMeStore/sockDir/getMe.sock
|
|
14
|
+
GETME_BASE_URL: http://unix
|
|
15
|
+
|
|
16
|
+
stdin_open: true
|
|
17
|
+
tty: false
|
|
18
|
+
|
|
19
|
+
restart: "no"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from .server import build_mcp
|
|
6
|
+
|
|
7
|
+
from .utills import _install_graceful_shutdown_handlers
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main() -> int:
|
|
11
|
+
_install_graceful_shutdown_handlers()
|
|
12
|
+
mcp = build_mcp()
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
print("Starting MCP server...")
|
|
16
|
+
mcp.run()
|
|
17
|
+
return 0
|
|
18
|
+
except (KeyboardInterrupt, SystemExit):
|
|
19
|
+
# quite shutdown in case of interrupts
|
|
20
|
+
return 0
|
|
21
|
+
except BrokenPipeError:
|
|
22
|
+
# treating broken pipe as a normal exit
|
|
23
|
+
return 0
|
|
24
|
+
finally:
|
|
25
|
+
try:
|
|
26
|
+
sys.stdout.flush()
|
|
27
|
+
except Exception:
|
|
28
|
+
pass
|
|
29
|
+
try:
|
|
30
|
+
sys.stderr.flush()
|
|
31
|
+
except Exception:
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if __name__ == "__main__":
|
|
36
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '1.0.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 1)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|