shaped-mcp 0.1.0__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.
- shaped_mcp-0.1.0/.gitignore +233 -0
- shaped_mcp-0.1.0/PKG-INFO +11 -0
- shaped_mcp-0.1.0/README.md +19 -0
- shaped_mcp-0.1.0/pyproject.toml +34 -0
- shaped_mcp-0.1.0/registry-entry.md +44 -0
- shaped_mcp-0.1.0/src/shaped_mcp/__init__.py +3 -0
- shaped_mcp-0.1.0/src/shaped_mcp/__main__.py +35 -0
- shaped_mcp-0.1.0/src/shaped_mcp/server.py +890 -0
- shaped_mcp-0.1.0/tests/__init__.py +1 -0
- shaped_mcp-0.1.0/tests/conftest.py +17 -0
- shaped_mcp-0.1.0/tests/test_http_transport_e2e.py +100 -0
- shaped_mcp-0.1.0/tests/test_server.py +692 -0
- shaped_mcp-0.1.0/tests/test_server_e2e.py +388 -0
- shaped_mcp-0.1.0/tests/test_stdio_transport_e2e.py +89 -0
- shaped_mcp-0.1.0/uv.lock +1606 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
.claude/
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib64/
|
|
19
|
+
log_tensorboard/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
pip-wheel-metadata/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
**/log_tensorboard/
|
|
54
|
+
**/tmp
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
.python-version
|
|
88
|
+
|
|
89
|
+
# pipenv
|
|
90
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
91
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
92
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
93
|
+
# install all needed dependencies.
|
|
94
|
+
#Pipfile.lock
|
|
95
|
+
|
|
96
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
97
|
+
__pypackages__/
|
|
98
|
+
|
|
99
|
+
# Celery stuff
|
|
100
|
+
celerybeat-schedule
|
|
101
|
+
celerybeat.pid
|
|
102
|
+
|
|
103
|
+
# SageMath parsed files
|
|
104
|
+
*.sage.py
|
|
105
|
+
|
|
106
|
+
# Environments
|
|
107
|
+
.env
|
|
108
|
+
.venv
|
|
109
|
+
env/
|
|
110
|
+
venv/
|
|
111
|
+
ENV/
|
|
112
|
+
env.bak/
|
|
113
|
+
venv.bak/
|
|
114
|
+
|
|
115
|
+
# Spyder project settings
|
|
116
|
+
.spyderproject
|
|
117
|
+
.spyproject
|
|
118
|
+
|
|
119
|
+
# Rope project settings
|
|
120
|
+
.ropeproject
|
|
121
|
+
|
|
122
|
+
# mkdocs documentation
|
|
123
|
+
/site
|
|
124
|
+
|
|
125
|
+
# mypy
|
|
126
|
+
.mypy_cache/
|
|
127
|
+
.dmypy.json
|
|
128
|
+
dmypy.json
|
|
129
|
+
|
|
130
|
+
# Pyre type checker
|
|
131
|
+
.pyre/
|
|
132
|
+
|
|
133
|
+
**/.DS_Store
|
|
134
|
+
.serverless
|
|
135
|
+
|
|
136
|
+
docker_mount
|
|
137
|
+
|
|
138
|
+
**/cdk.out
|
|
139
|
+
.aws-sam
|
|
140
|
+
.build
|
|
141
|
+
|
|
142
|
+
# Wheel image builder
|
|
143
|
+
.net
|
|
144
|
+
|
|
145
|
+
.vscode/
|
|
146
|
+
|
|
147
|
+
hydra_out/
|
|
148
|
+
|
|
149
|
+
# dependencies
|
|
150
|
+
/node_modules
|
|
151
|
+
**/node_modules
|
|
152
|
+
/.pnp
|
|
153
|
+
.pnp.js
|
|
154
|
+
|
|
155
|
+
# testing
|
|
156
|
+
/coverage
|
|
157
|
+
|
|
158
|
+
# next.js
|
|
159
|
+
**/.next
|
|
160
|
+
/out/
|
|
161
|
+
|
|
162
|
+
# production
|
|
163
|
+
/build
|
|
164
|
+
|
|
165
|
+
# misc
|
|
166
|
+
*.pem
|
|
167
|
+
|
|
168
|
+
# debug
|
|
169
|
+
npm-debug.log*
|
|
170
|
+
yarn-debug.log*
|
|
171
|
+
yarn-error.log*
|
|
172
|
+
.pnpm-debug.log*
|
|
173
|
+
|
|
174
|
+
# local env files
|
|
175
|
+
.env*.local
|
|
176
|
+
.env
|
|
177
|
+
|
|
178
|
+
# vercel
|
|
179
|
+
.vercel
|
|
180
|
+
|
|
181
|
+
# typescript
|
|
182
|
+
*.tsbuildinfo
|
|
183
|
+
|
|
184
|
+
.contentlayer
|
|
185
|
+
|
|
186
|
+
# terraform
|
|
187
|
+
**/.terraform/*
|
|
188
|
+
terraform.tfstate*
|
|
189
|
+
cast-ai.key
|
|
190
|
+
.kubeconfig
|
|
191
|
+
|
|
192
|
+
# runhouse
|
|
193
|
+
.rh
|
|
194
|
+
|
|
195
|
+
.pymon
|
|
196
|
+
|
|
197
|
+
# Rust
|
|
198
|
+
target
|
|
199
|
+
Cargo.lock
|
|
200
|
+
|
|
201
|
+
# Handled by .gitignores in subdirectories
|
|
202
|
+
!fibertide-infrastructure-modules/**
|
|
203
|
+
!secrets/**
|
|
204
|
+
!vpn/**
|
|
205
|
+
|
|
206
|
+
# Cursor
|
|
207
|
+
.cursor
|
|
208
|
+
!.cursor/mcp.json.example
|
|
209
|
+
.cursor/mcp.json
|
|
210
|
+
PR_SUMMARY.md
|
|
211
|
+
|
|
212
|
+
# SDK
|
|
213
|
+
src/sdk/python/.openapi-generator/
|
|
214
|
+
src/sdk/nodejs/.openapi-generator/
|
|
215
|
+
src/sdk/nodejs/dist/
|
|
216
|
+
src/sdk/nodejs/package-lock.json
|
|
217
|
+
# Shaped-docs (Docusaurus site)
|
|
218
|
+
sites/shaped-docs/node_modules/
|
|
219
|
+
sites/shaped-docs/build/
|
|
220
|
+
sites/shaped-docs/.docusaurus/
|
|
221
|
+
sites/shaped-docs/.cache-loader/
|
|
222
|
+
sites/shaped-docs/.env
|
|
223
|
+
|
|
224
|
+
# Console test results
|
|
225
|
+
src/pkg/images/console/test-results/
|
|
226
|
+
src/pkg/images/console/playwright-report/
|
|
227
|
+
src/pkg/images/console/coverage/
|
|
228
|
+
terraform.tfvars
|
|
229
|
+
|
|
230
|
+
# Claude
|
|
231
|
+
.claude/
|
|
232
|
+
|
|
233
|
+
.pnpm-store/*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shaped-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Shaped - retrieval for AI agents, search engines, and more
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Requires-Dist: httpx>=0.27.0
|
|
7
|
+
Requires-Dist: mcp>=1.0.0
|
|
8
|
+
Requires-Dist: shaped>=2.0.31
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
11
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Shaped MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server that exposes Shaped's API to AI agents. Enables Cursor, Claude Desktop, and other MCP clients to create and manage tables, views, engines, and run queries.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. Install: `pip install -e .` (from this directory) or `pip install shaped-mcp` (PyPI).
|
|
8
|
+
2. Set `SHAPED_API_KEY` in your environment.
|
|
9
|
+
3. Configure your AI tool (see [Usage Guide](../../docs/mcp-usage.md)).
|
|
10
|
+
4. Run tests: `pytest mcp/tests/` (with `pip install -e ".[dev]"`).
|
|
11
|
+
|
|
12
|
+
## Documentation
|
|
13
|
+
|
|
14
|
+
- **[Build Plan](PLAN.md)** – Implementation plan, tools, and phases.
|
|
15
|
+
- **[Usage Guide](../../docs/mcp-usage.md)** – How to configure Cursor, Claude, and other MCP clients.
|
|
16
|
+
|
|
17
|
+
## Status
|
|
18
|
+
|
|
19
|
+
Phase 1–3 implemented: STDIO, HTTP (Streamable), Bearer auth, prompts, Helm chart, PyPI publish, deploy workflow. See `PLAN.md` for full roadmap. For local Cursor testing, copy `.cursor/mcp.json.example` to `.cursor/mcp.json` and set `SHAPED_API_KEY`. To list in the [MCP Registry](https://registry.modelcontextprotocol.io/), use `registry-entry.md`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "shaped-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server for Shaped - retrieval for AI agents, search engines, and more"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"mcp>=1.0.0",
|
|
8
|
+
"shaped>=2.0.31",
|
|
9
|
+
"httpx>=0.27.0",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
[project.optional-dependencies]
|
|
13
|
+
dev = [
|
|
14
|
+
"pytest>=7.0.0",
|
|
15
|
+
"pytest-asyncio>=0.21.0",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[tool.pytest.ini_options]
|
|
19
|
+
testpaths = ["tests"]
|
|
20
|
+
pythonpath = ["src"]
|
|
21
|
+
asyncio_mode = "auto"
|
|
22
|
+
markers = [
|
|
23
|
+
"integration: tests that call the real Shaped API (require SHAPED_API_KEY)",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
shaped-mcp = "shaped_mcp.__main__:main"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["hatchling"]
|
|
31
|
+
build-backend = "hatchling.build"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/shaped_mcp"]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Shaped MCP Server – Registry Entry
|
|
2
|
+
|
|
3
|
+
Use this information when submitting to the [MCP Registry](https://registry.modelcontextprotocol.io/).
|
|
4
|
+
|
|
5
|
+
## Metadata
|
|
6
|
+
|
|
7
|
+
- **Name:** Shaped
|
|
8
|
+
- **Description:** MCP server for Shaped - create and manage tables, views, engines, and run retrieval queries. Enables AI agents to use Shaped's hybrid retrieval, trained scoring, and fine-tuning for recommendations and search.
|
|
9
|
+
- **Repository:** https://github.com/shaped-ai/magnus (monorepo; MCP package in `mcp/`)
|
|
10
|
+
- **PyPI:** https://pypi.org/project/shaped-mcp/
|
|
11
|
+
- **Documentation:** See `docs/mcp-usage.md` in the repo
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install shaped-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration (STDIO)
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"shaped": {
|
|
25
|
+
"command": "shaped-mcp",
|
|
26
|
+
"env": {
|
|
27
|
+
"SHAPED_API_KEY": "${SHAPED_API_KEY}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Hosted Endpoint (HTTP)
|
|
35
|
+
|
|
36
|
+
- **URL:** https://mcp.shaped.ai/mcp
|
|
37
|
+
- **Auth:** `Authorization: Bearer <SHAPED_API_KEY>`
|
|
38
|
+
|
|
39
|
+
## Tools
|
|
40
|
+
|
|
41
|
+
Query: shaped_query, shaped_search, shaped_similar_items, shaped_feed, shaped_similar_users, shaped_rerank
|
|
42
|
+
Tables: shaped_list_tables, shaped_get_table, shaped_create_table, shaped_delete_table, shaped_insert_rows
|
|
43
|
+
Views: shaped_list_views, shaped_get_view, shaped_create_view, shaped_delete_view
|
|
44
|
+
Engines: shaped_list_engines, shaped_get_engine, shaped_create_engine, shaped_update_engine, shaped_delete_engine, shaped_get_engine_status
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Entry point for shaped-mcp CLI."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main() -> None:
|
|
8
|
+
"""Entry point for the shaped-mcp CLI."""
|
|
9
|
+
parser = argparse.ArgumentParser(description="Shaped MCP server")
|
|
10
|
+
parser.add_argument(
|
|
11
|
+
"--transport",
|
|
12
|
+
choices=["stdio", "streamable-http"],
|
|
13
|
+
default="stdio",
|
|
14
|
+
help="Transport: stdio (default) or streamable-http",
|
|
15
|
+
)
|
|
16
|
+
parser.add_argument(
|
|
17
|
+
"--host", default="0.0.0.0", help="Host for HTTP (default: 0.0.0.0)"
|
|
18
|
+
)
|
|
19
|
+
parser.add_argument(
|
|
20
|
+
"--port", type=int, default=8080, help="Port for HTTP (default: 8080)"
|
|
21
|
+
)
|
|
22
|
+
args = parser.parse_args()
|
|
23
|
+
|
|
24
|
+
# Set env before import so FastMCP picks up host/port.
|
|
25
|
+
if args.transport != "stdio":
|
|
26
|
+
os.environ["FASTMCP_HOST"] = args.host
|
|
27
|
+
os.environ["FASTMCP_PORT"] = str(args.port)
|
|
28
|
+
|
|
29
|
+
from shaped_mcp.server import run # noqa: E402
|
|
30
|
+
|
|
31
|
+
run(transport=args.transport, host=args.host, port=args.port)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if __name__ == "__main__":
|
|
35
|
+
main()
|