deepset-mcp 0.0.4__tar.gz → 0.0.5__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.
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/PKG-INFO +59 -13
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/README.md +54 -12
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/pyproject.toml +7 -1
- deepset_mcp-0.0.5/src/deepset_mcp/__init__.py +10 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/transport.py +5 -2
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/config.py +9 -1
- deepset_mcp-0.0.5/src/deepset_mcp/main.py +209 -0
- deepset_mcp-0.0.5/src/deepset_mcp/py.typed +0 -0
- deepset_mcp-0.0.5/src/deepset_mcp/server.py +154 -0
- deepset_mcp-0.0.5/src/deepset_mcp/store.py +58 -0
- deepset_mcp-0.0.5/src/deepset_mcp/tool_factory.py +371 -0
- deepset_mcp-0.0.5/src/deepset_mcp/tool_models.py +42 -0
- deepset_mcp-0.0.5/src/deepset_mcp/tool_registry.py +208 -0
- deepset_mcp-0.0.5/src/deepset_mcp/tools/object_store.py +49 -0
- deepset_mcp-0.0.5/src/deepset_mcp/tools/tokonomics/__init__.py +18 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/tokonomics/decorators.py +60 -87
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/tokonomics/explorer.py +32 -17
- deepset_mcp-0.0.5/src/deepset_mcp/tools/tokonomics/object_store.py +158 -0
- deepset_mcp-0.0.5/test/integration/tools/tokonomics/test_integration_tokonomics.py +662 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/test_transport.py +41 -0
- deepset_mcp-0.0.5/test/unit/test_server_base_url.py +52 -0
- deepset_mcp-0.0.5/test/unit/test_store.py +115 -0
- deepset_mcp-0.0.5/test/unit/test_tool_factory.py +696 -0
- deepset_mcp-0.0.5/test/unit/tools/__init__.py +4 -0
- deepset_mcp-0.0.5/test/unit/tools/tokonomics/__init__.py +4 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/tokonomics/test_decorators.py +123 -41
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/tokonomics/test_explorer.py +4 -4
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/tokonomics/test_integration.py +51 -37
- deepset_mcp-0.0.5/test/unit/tools/tokonomics/test_object_store.py +209 -0
- deepset_mcp-0.0.5/test/unit/tools/tokonomics/test_object_store_backends.py +250 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/uv.lock +144 -0
- deepset_mcp-0.0.4/src/deepset_mcp/__init__.py +0 -10
- deepset_mcp-0.0.4/src/deepset_mcp/main.py +0 -192
- deepset_mcp-0.0.4/src/deepset_mcp/store.py +0 -9
- deepset_mcp-0.0.4/src/deepset_mcp/tool_factory.py +0 -498
- deepset_mcp-0.0.4/src/deepset_mcp/tools/tokonomics/__init__.py +0 -77
- deepset_mcp-0.0.4/src/deepset_mcp/tools/tokonomics/object_store.py +0 -181
- deepset_mcp-0.0.4/test/unit/tools/tokonomics/test_explorable.py +0 -169
- deepset_mcp-0.0.4/test/unit/tools/tokonomics/test_object_ref.py +0 -165
- deepset_mcp-0.0.4/test/unit/tools/tokonomics/test_object_store.py +0 -224
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.github/workflows/ai_agent.yml +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.github/workflows/ci.yml +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.github/workflows/docker_push.yml +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.github/workflows/pypi_release.yml +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.gitignore +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/.python-version +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/Dockerfile +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/LICENSE +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/Makefile +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/REPO.md +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/assets/claude_desktop_projects.png +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/assets/claude_desktop_with_tools.png +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/assets/deepset-mcp-3.gif +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/entrypoint.sh +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/license-header.txt +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/licenserc.toml +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/README.md +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/client.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/custom_components/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/custom_components/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/custom_components/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/custom_components/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/exceptions.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/haystack_service/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/haystack_service/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/haystack_service/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/indexes/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/indexes/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/indexes/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/indexes/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/integrations/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/integrations/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/integrations/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/integrations/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline/log_level.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline_template/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline_template/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline_template/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/pipeline_template/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/secrets/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/secrets/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/secrets/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/secrets/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/shared_models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/user/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/user/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/user/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/workspace/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/workspace/models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/workspace/protocols.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/api/workspace/resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/initialize_embedding_model.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/prompts/deepset_copilot_prompt.md +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/prompts/deepset_debugging_agent.md +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/custom_components.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/doc_search.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/haystack_service.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/haystack_service_models.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/indexes.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/model_protocol.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/pipeline.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/pipeline_template.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/secrets.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/src/deepset_mcp/tools/workspace.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/conftest.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_haystack_service_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_index_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_integrations_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_pipeline_logs.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_pipeline_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_pipeline_template_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_secret_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/integration/test_integration_workspace_resource.py +0 -0
- {deepset_mcp-0.0.4/test/unit → deepset_mcp-0.0.5/test/integration/tools}/__init__.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api → deepset_mcp-0.0.5/test/integration/tools/tokonomics}/__init__.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/custom_components → deepset_mcp-0.0.5/test/unit}/__init__.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/haystack_service → deepset_mcp-0.0.5/test/unit/api}/__init__.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/indexes → deepset_mcp-0.0.5/test/unit/api/custom_components}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/custom_components/test_custom_components_resource.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/pipeline → deepset_mcp-0.0.5/test/unit/api/haystack_service}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/haystack_service/test_haystack_service_resource.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/pipeline_template → deepset_mcp-0.0.5/test/unit/api/indexes}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/indexes/test_index_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/integrations/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/integrations/test_integration_resource.py +0 -0
- {deepset_mcp-0.0.4/test/unit/api/user → deepset_mcp-0.0.5/test/unit/api/pipeline}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/pipeline/test_pipeline_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/pipeline/test_pipeline_resource_search.py +0 -0
- {deepset_mcp-0.0.4/test/unit/tools → deepset_mcp-0.0.5/test/unit/api/pipeline_template}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/pipeline_template/test_pipeline_template_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/secrets/test_secret_resource.py +0 -0
- {deepset_mcp-0.0.4/test/unit/tools/tokonomics → deepset_mcp-0.0.5/test/unit/api/user}/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/user/test_user_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/workspace/__init__.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/api/workspace/test_workspace_resource.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/conftest.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/test_async_deepset_client.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_custom_components.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_doc_search.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_haystack_service.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_indexes.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_pipeline.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_pipeline_template.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_secrets.py +0 -0
- {deepset_mcp-0.0.4 → deepset_mcp-0.0.5}/test/unit/tools/test_workspace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepset-mcp
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Collection of MCP tools and Agents to work with the deepset AI platform. Create, debug or learn about pipelines on the platform. Useable from the CLI, Cursor, Claude Code, or other MCP clients.
|
|
5
5
|
Project-URL: Homepage, https://deepset.ai
|
|
6
6
|
Author-email: Mathis Lucka <mathis.lucka@deepset.ai>, Tanay Soni <tanay.soni@deepset.ai>
|
|
@@ -25,10 +25,14 @@ Requires-Dist: httpx
|
|
|
25
25
|
Requires-Dist: mcp>=1.10.1
|
|
26
26
|
Requires-Dist: model2vec
|
|
27
27
|
Requires-Dist: numpy
|
|
28
|
+
Requires-Dist: orjson
|
|
28
29
|
Requires-Dist: pydantic>=2.0.0
|
|
29
30
|
Requires-Dist: pyjwt[crypto]
|
|
30
31
|
Requires-Dist: pyyaml
|
|
31
32
|
Requires-Dist: rich
|
|
33
|
+
Requires-Dist: typer
|
|
34
|
+
Provides-Extra: redis
|
|
35
|
+
Requires-Dist: redis>=4.0.0; extra == 'redis'
|
|
32
36
|
Description-Content-Type: text/markdown
|
|
33
37
|
|
|
34
38
|
# MCP Server for the deepset AI platform
|
|
@@ -53,6 +57,7 @@ Using the server, you benefit from faster creation of pipelines or indexes and s
|
|
|
53
57
|
- [2.2 Manage Tools](#manage-tools)
|
|
54
58
|
- [2.3 Reduce Tool Count](#reduce-tool-count)
|
|
55
59
|
- [2.4 Prompts](#prompts)
|
|
60
|
+
- [2.5 Providing a Remote MCP Server](#providing-a-remote-mcp-server)
|
|
56
61
|
- [3. Use Cases](#use-cases)
|
|
57
62
|
- [3.1. Creating Pipelines](#creating-pipelines)
|
|
58
63
|
- [3.2. Debugging Pipelines](#debugging-pipelines)
|
|
@@ -249,7 +254,6 @@ For example:
|
|
|
249
254
|
"env": {
|
|
250
255
|
"DEEPSET_API_KEY":"<DEEPSET_API_KEY>"
|
|
251
256
|
}
|
|
252
|
-
|
|
253
257
|
}
|
|
254
258
|
}
|
|
255
259
|
}
|
|
@@ -353,8 +357,6 @@ All tools exposed through the MCP server have minimal prompts. Any Agent interac
|
|
|
353
357
|
|
|
354
358
|
View the **recommended prompt** [here](src/deepset_mcp/prompts/deepset_debugging_agent.md).
|
|
355
359
|
|
|
356
|
-
This prompt is also exposed as the `deepset_recommended_prompt` on the MCP server.
|
|
357
|
-
|
|
358
360
|
In Cursor, add the prompt to `.cursorrules`.
|
|
359
361
|
|
|
360
362
|
In Claude Desktop, create a "Project" and add the prompt as system instructions.
|
|
@@ -362,6 +364,48 @@ In Claude Desktop, create a "Project" and add the prompt as system instructions.
|
|
|
362
364
|
You may find that customizing the prompt for your specific needs yields best results.
|
|
363
365
|
|
|
364
366
|
|
|
367
|
+
### Providing a Remote MCP Server
|
|
368
|
+
|
|
369
|
+
The `deepset-mcp` package can be configured to run as a remote MCP server, allowing you to provide deepset platform access to multiple users through a centralized service. This is particularly useful for organizations that want to deploy the MCP server as a shared service or integrate it into existing infrastructure.
|
|
370
|
+
|
|
371
|
+
**Key Requirements**
|
|
372
|
+
|
|
373
|
+
When running as a remote MCP server, you must configure the following:
|
|
374
|
+
|
|
375
|
+
1. **Transport Protocol**: Use `streamable-http` instead of the default `stdio` transport
|
|
376
|
+
2. **Authentication**: Implement OAuth or similar authentication flow to securely handle user credentials
|
|
377
|
+
3. **Authorization Headers**: Ensure client requests include proper `Authorization` headers with Bearer token for deepset access
|
|
378
|
+
4. **Dynamic Workspace Mode**: Use `workspace_mode='dynamic'` to support multiple users with different workspaces
|
|
379
|
+
5. **API Key Management**: Enable `get_api_key_from_auth_header` to extract deepset API keys from request headers
|
|
380
|
+
|
|
381
|
+
**Implementation Example**
|
|
382
|
+
|
|
383
|
+
Here's a complete example of how to set up a remote MCP server:
|
|
384
|
+
|
|
385
|
+
```python
|
|
386
|
+
from mcp.server.fastmcp import FastMCP
|
|
387
|
+
from deepset_mcp import configure_mcp_server, WorkspaceMode, ALL_DEEPSET_TOOLS, DEEPSET_DOCS_DEFAULT_SHARE_URL
|
|
388
|
+
|
|
389
|
+
# Create FastMCP instance
|
|
390
|
+
mcp = FastMCP("Deepset Remote MCP Server")
|
|
391
|
+
|
|
392
|
+
# Add authentication middleware
|
|
393
|
+
|
|
394
|
+
# Configure the deepset MCP server
|
|
395
|
+
configure_mcp_server(
|
|
396
|
+
mcp_server_instance=mcp,
|
|
397
|
+
workspace_mode=WorkspaceMode.DYNAMIC,
|
|
398
|
+
tools_to_register=ALL_DEEPSET_TOOLS,
|
|
399
|
+
deepset_docs_shareable_prototype_url=DEEPSET_DOCS_DEFAULT_SHARE_URL,
|
|
400
|
+
get_api_key_from_authorization_header=True
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
# Run the server
|
|
404
|
+
if __name__ == "__main__":
|
|
405
|
+
mcp.run(transport="streamable-http")
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
|
|
365
409
|
## Use Cases
|
|
366
410
|
|
|
367
411
|
The primary way to use the deepset MCP server is through an LLM that interacts with the deepset MCP tools in an agentic way.
|
|
@@ -407,7 +451,7 @@ If your pipeline is not deployed yet, the Agent can autonomously validate it and
|
|
|
407
451
|
|
|
408
452
|
### deepset-mcp
|
|
409
453
|
|
|
410
|
-
The `deepset-mcp
|
|
454
|
+
The `deepset-mcp` command starts the Deepset MCP server to interact with the deepset AI platform.
|
|
411
455
|
|
|
412
456
|
You can run it in your terminal via `uvx deepset-mcp`.
|
|
413
457
|
|
|
@@ -417,14 +461,16 @@ If you want to run a specific version, you can run:
|
|
|
417
461
|
|
|
418
462
|
The following options are available:
|
|
419
463
|
|
|
420
|
-
| Option
|
|
421
|
-
|
|
422
|
-
| --api-key
|
|
423
|
-
| --workspace
|
|
424
|
-
| --workspace-mode
|
|
425
|
-
| --list-tools
|
|
426
|
-
| --tools
|
|
427
|
-
| --docs-share-url
|
|
464
|
+
| Option | Description |
|
|
465
|
+
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
466
|
+
| --api-key | The deepset API key to use. Can also be set it via the "DEEPSET_API_KEY" environment variable. |
|
|
467
|
+
| --workspace | The deepset workspace to use. Can also be set via the "DEEPSET_WORKSPACE" environment variable. |
|
|
468
|
+
| --workspace-mode | If you want to allow an Agent to access multiple workspaces (Options: static, dynamic; default: static) |
|
|
469
|
+
| --list-tools | List all available tools (does not start the server). |
|
|
470
|
+
| --tools | Pass a space separated list of tool names that you want the server to register. |
|
|
471
|
+
| --docs-share-url | Pass a [shared prototype](https://docs.cloud.deepset.ai/docs/share-a-pipeline-prototype) URL to customize which pipeline the Agent uses for documentation search (default: official deepset documentation) |
|
|
472
|
+
| --api-key-from-auth-header | Get the deepset API key from the request's authorization header instead of using a static key. |
|
|
473
|
+
| --transport | The type of transport to use for running the MCP server (Options: stdio, streamable-http; default: stdio) |
|
|
428
474
|
|
|
429
475
|
|
|
430
476
|
### Tools
|
|
@@ -20,6 +20,7 @@ Using the server, you benefit from faster creation of pipelines or indexes and s
|
|
|
20
20
|
- [2.2 Manage Tools](#manage-tools)
|
|
21
21
|
- [2.3 Reduce Tool Count](#reduce-tool-count)
|
|
22
22
|
- [2.4 Prompts](#prompts)
|
|
23
|
+
- [2.5 Providing a Remote MCP Server](#providing-a-remote-mcp-server)
|
|
23
24
|
- [3. Use Cases](#use-cases)
|
|
24
25
|
- [3.1. Creating Pipelines](#creating-pipelines)
|
|
25
26
|
- [3.2. Debugging Pipelines](#debugging-pipelines)
|
|
@@ -216,7 +217,6 @@ For example:
|
|
|
216
217
|
"env": {
|
|
217
218
|
"DEEPSET_API_KEY":"<DEEPSET_API_KEY>"
|
|
218
219
|
}
|
|
219
|
-
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -320,8 +320,6 @@ All tools exposed through the MCP server have minimal prompts. Any Agent interac
|
|
|
320
320
|
|
|
321
321
|
View the **recommended prompt** [here](src/deepset_mcp/prompts/deepset_debugging_agent.md).
|
|
322
322
|
|
|
323
|
-
This prompt is also exposed as the `deepset_recommended_prompt` on the MCP server.
|
|
324
|
-
|
|
325
323
|
In Cursor, add the prompt to `.cursorrules`.
|
|
326
324
|
|
|
327
325
|
In Claude Desktop, create a "Project" and add the prompt as system instructions.
|
|
@@ -329,6 +327,48 @@ In Claude Desktop, create a "Project" and add the prompt as system instructions.
|
|
|
329
327
|
You may find that customizing the prompt for your specific needs yields best results.
|
|
330
328
|
|
|
331
329
|
|
|
330
|
+
### Providing a Remote MCP Server
|
|
331
|
+
|
|
332
|
+
The `deepset-mcp` package can be configured to run as a remote MCP server, allowing you to provide deepset platform access to multiple users through a centralized service. This is particularly useful for organizations that want to deploy the MCP server as a shared service or integrate it into existing infrastructure.
|
|
333
|
+
|
|
334
|
+
**Key Requirements**
|
|
335
|
+
|
|
336
|
+
When running as a remote MCP server, you must configure the following:
|
|
337
|
+
|
|
338
|
+
1. **Transport Protocol**: Use `streamable-http` instead of the default `stdio` transport
|
|
339
|
+
2. **Authentication**: Implement OAuth or similar authentication flow to securely handle user credentials
|
|
340
|
+
3. **Authorization Headers**: Ensure client requests include proper `Authorization` headers with Bearer token for deepset access
|
|
341
|
+
4. **Dynamic Workspace Mode**: Use `workspace_mode='dynamic'` to support multiple users with different workspaces
|
|
342
|
+
5. **API Key Management**: Enable `get_api_key_from_auth_header` to extract deepset API keys from request headers
|
|
343
|
+
|
|
344
|
+
**Implementation Example**
|
|
345
|
+
|
|
346
|
+
Here's a complete example of how to set up a remote MCP server:
|
|
347
|
+
|
|
348
|
+
```python
|
|
349
|
+
from mcp.server.fastmcp import FastMCP
|
|
350
|
+
from deepset_mcp import configure_mcp_server, WorkspaceMode, ALL_DEEPSET_TOOLS, DEEPSET_DOCS_DEFAULT_SHARE_URL
|
|
351
|
+
|
|
352
|
+
# Create FastMCP instance
|
|
353
|
+
mcp = FastMCP("Deepset Remote MCP Server")
|
|
354
|
+
|
|
355
|
+
# Add authentication middleware
|
|
356
|
+
|
|
357
|
+
# Configure the deepset MCP server
|
|
358
|
+
configure_mcp_server(
|
|
359
|
+
mcp_server_instance=mcp,
|
|
360
|
+
workspace_mode=WorkspaceMode.DYNAMIC,
|
|
361
|
+
tools_to_register=ALL_DEEPSET_TOOLS,
|
|
362
|
+
deepset_docs_shareable_prototype_url=DEEPSET_DOCS_DEFAULT_SHARE_URL,
|
|
363
|
+
get_api_key_from_authorization_header=True
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
# Run the server
|
|
367
|
+
if __name__ == "__main__":
|
|
368
|
+
mcp.run(transport="streamable-http")
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
|
|
332
372
|
## Use Cases
|
|
333
373
|
|
|
334
374
|
The primary way to use the deepset MCP server is through an LLM that interacts with the deepset MCP tools in an agentic way.
|
|
@@ -374,7 +414,7 @@ If your pipeline is not deployed yet, the Agent can autonomously validate it and
|
|
|
374
414
|
|
|
375
415
|
### deepset-mcp
|
|
376
416
|
|
|
377
|
-
The `deepset-mcp
|
|
417
|
+
The `deepset-mcp` command starts the Deepset MCP server to interact with the deepset AI platform.
|
|
378
418
|
|
|
379
419
|
You can run it in your terminal via `uvx deepset-mcp`.
|
|
380
420
|
|
|
@@ -384,14 +424,16 @@ If you want to run a specific version, you can run:
|
|
|
384
424
|
|
|
385
425
|
The following options are available:
|
|
386
426
|
|
|
387
|
-
| Option
|
|
388
|
-
|
|
389
|
-
| --api-key
|
|
390
|
-
| --workspace
|
|
391
|
-
| --workspace-mode
|
|
392
|
-
| --list-tools
|
|
393
|
-
| --tools
|
|
394
|
-
| --docs-share-url
|
|
427
|
+
| Option | Description |
|
|
428
|
+
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
429
|
+
| --api-key | The deepset API key to use. Can also be set it via the "DEEPSET_API_KEY" environment variable. |
|
|
430
|
+
| --workspace | The deepset workspace to use. Can also be set via the "DEEPSET_WORKSPACE" environment variable. |
|
|
431
|
+
| --workspace-mode | If you want to allow an Agent to access multiple workspaces (Options: static, dynamic; default: static) |
|
|
432
|
+
| --list-tools | List all available tools (does not start the server). |
|
|
433
|
+
| --tools | Pass a space separated list of tool names that you want the server to register. |
|
|
434
|
+
| --docs-share-url | Pass a [shared prototype](https://docs.cloud.deepset.ai/docs/share-a-pipeline-prototype) URL to customize which pipeline the Agent uses for documentation search (default: official deepset documentation) |
|
|
435
|
+
| --api-key-from-auth-header | Get the deepset API key from the request's authorization header instead of using a static key. |
|
|
436
|
+
| --transport | The type of transport to use for running the MCP server (Options: stdio, streamable-http; default: stdio) |
|
|
395
437
|
|
|
396
438
|
|
|
397
439
|
### Tools
|
|
@@ -49,19 +49,22 @@ dependencies = [
|
|
|
49
49
|
"glom",
|
|
50
50
|
"rich",
|
|
51
51
|
"pyjwt[crypto]",
|
|
52
|
+
"typer",
|
|
53
|
+
"orjson",
|
|
52
54
|
]
|
|
53
55
|
|
|
54
56
|
[project.urls]
|
|
55
57
|
Homepage = "https://deepset.ai"
|
|
56
58
|
|
|
57
59
|
[project.scripts]
|
|
58
|
-
deepset-mcp = "deepset_mcp.main:
|
|
60
|
+
deepset-mcp = "deepset_mcp.main:app"
|
|
59
61
|
|
|
60
62
|
[dependency-groups]
|
|
61
63
|
dev = [
|
|
62
64
|
"pytest",
|
|
63
65
|
"pytest-asyncio",
|
|
64
66
|
"python-dotenv",
|
|
67
|
+
"docker"
|
|
65
68
|
]
|
|
66
69
|
lint = [
|
|
67
70
|
"ruff",
|
|
@@ -73,6 +76,9 @@ types = [
|
|
|
73
76
|
"pandas-stubs",
|
|
74
77
|
]
|
|
75
78
|
|
|
79
|
+
[project.optional-dependencies]
|
|
80
|
+
redis = ["redis>=4.0.0"]
|
|
81
|
+
|
|
76
82
|
[tool.hatch.version]
|
|
77
83
|
source = "uv-dynamic-versioning"
|
|
78
84
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
from deepset_mcp.config import DEEPSET_DOCS_DEFAULT_SHARE_URL
|
|
6
|
+
from deepset_mcp.server import configure_mcp_server
|
|
7
|
+
from deepset_mcp.tool_models import WorkspaceMode
|
|
8
|
+
from deepset_mcp.tool_registry import ALL_DEEPSET_TOOLS
|
|
9
|
+
|
|
10
|
+
__all__ = ["configure_mcp_server", "WorkspaceMode", "ALL_DEEPSET_TOOLS", "DEEPSET_DOCS_DEFAULT_SHARE_URL"]
|
|
@@ -6,6 +6,7 @@ import json
|
|
|
6
6
|
import time
|
|
7
7
|
from collections.abc import AsyncIterator
|
|
8
8
|
from contextlib import AbstractAsyncContextManager, asynccontextmanager
|
|
9
|
+
from copy import deepcopy
|
|
9
10
|
from dataclasses import dataclass
|
|
10
11
|
from typing import Any, Generic, Literal, Protocol, TypeVar, cast, overload
|
|
11
12
|
|
|
@@ -198,8 +199,10 @@ class AsyncTransport:
|
|
|
198
199
|
config : dict, optional
|
|
199
200
|
Configuration for httpx.AsyncClient, e.g., {'timeout': 10.0}
|
|
200
201
|
"""
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
# We deepcopy the config so that we don't mutate it when used for subsequent initializations
|
|
203
|
+
config = deepcopy(config) or {}
|
|
204
|
+
|
|
205
|
+
# Merge auth and other config headers
|
|
203
206
|
headers = config.pop("headers", {})
|
|
204
207
|
headers.setdefault("Authorization", f"Bearer {api_key}")
|
|
205
208
|
# Build client kwargs
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
"""This module contains static configuration for the deepset MCP server."""
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import importlib.metadata
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
__version__ = importlib.metadata.version("deepset-mcp")
|
|
11
|
+
except importlib.metadata.PackageNotFoundError:
|
|
12
|
+
__version__ = "0.0.0" # Fallback for development mode
|
|
13
|
+
|
|
14
|
+
PACKAGE_VERSION = __version__
|
|
8
15
|
|
|
9
16
|
# We need this mapping to which environment variables integrations are mapped to
|
|
10
17
|
# The mapping is maintained in the pipeline operator:
|
|
@@ -29,5 +36,6 @@ TOKEN_DOMAIN_MAPPING = {
|
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
DEEPSET_DOCS_DEFAULT_SHARE_URL = "https://cloud.deepset.ai/shared_prototypes?share_token=prototype_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3ODM0MjE0OTguNTk5LCJhdWQiOiJleHRlcm5hbCB1c2VyIiwiaXNzIjoiZEMiLCJ3b3Jrc3BhY2VfaWQiOiI4YzI0ZjExMi1iMjljLTQ5MWMtOTkzOS1hZTkxMDRhNTQyMWMiLCJ3b3Jrc3BhY2VfbmFtZSI6ImRjLWRvY3MtY29udGVudCIsIm9yZ2FuaXphdGlvbl9pZCI6ImNhOWYxNGQ0LWMyYzktNDYwZC04ZDI2LWY4Y2IwYWNhMDI0ZiIsInNoYXJlX2lkIjoiY2Y3MTA3ODAtOThmNi00MzlmLThiNzYtMmMwNDkyODNiMDZhIiwibG9naW5fcmVxdWlyZWQiOmZhbHNlfQ.5j6DCNRQ1_KB8lhIJqHyw2hBIleEW1_Y_UBuH6MTYY0"
|
|
39
|
+
DOCS_SEARCH_TOOL_NAME = "search_docs"
|
|
32
40
|
|
|
33
41
|
DEFAULT_CLIENT_HEADER = {"headers": {"User-Agent": f"deepset-mcp/{__version__}"}}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
import os
|
|
7
|
+
from enum import StrEnum
|
|
8
|
+
from typing import Annotated
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
from mcp.server.fastmcp import FastMCP
|
|
12
|
+
|
|
13
|
+
from deepset_mcp.config import DEEPSET_DOCS_DEFAULT_SHARE_URL, DOCS_SEARCH_TOOL_NAME
|
|
14
|
+
from deepset_mcp.server import configure_mcp_server
|
|
15
|
+
from deepset_mcp.tool_models import WorkspaceMode
|
|
16
|
+
from deepset_mcp.tool_registry import TOOL_REGISTRY
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class TransportEnum(StrEnum):
|
|
20
|
+
"""Transport mode for the MCP server."""
|
|
21
|
+
|
|
22
|
+
STDIO = "stdio"
|
|
23
|
+
STREAMABLE_HTTP = "streamable-http"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
app = typer.Typer(
|
|
27
|
+
name="deepset-mcp",
|
|
28
|
+
help="Run the Deepset MCP server to interact with the deepset AI platform.",
|
|
29
|
+
no_args_is_help=True,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@app.command()
|
|
34
|
+
def main(
|
|
35
|
+
workspace: Annotated[
|
|
36
|
+
str | None,
|
|
37
|
+
typer.Option(
|
|
38
|
+
"--workspace",
|
|
39
|
+
help="Deepset workspace name. Can also be set via DEEPSET_WORKSPACE environment variable.",
|
|
40
|
+
),
|
|
41
|
+
] = None,
|
|
42
|
+
api_key: Annotated[
|
|
43
|
+
str | None,
|
|
44
|
+
typer.Option(
|
|
45
|
+
"--api-key",
|
|
46
|
+
help="Deepset API key for authentication. Can also be set via DEEPSET_API_KEY environment variable.",
|
|
47
|
+
),
|
|
48
|
+
] = None,
|
|
49
|
+
api_url: Annotated[
|
|
50
|
+
str | None,
|
|
51
|
+
typer.Option(
|
|
52
|
+
"--api-url",
|
|
53
|
+
help="Deepset API base URL. Can also be set via DEEPSET_API_URL environment variable.",
|
|
54
|
+
),
|
|
55
|
+
] = None,
|
|
56
|
+
docs_share_url: Annotated[
|
|
57
|
+
str | None,
|
|
58
|
+
typer.Option(
|
|
59
|
+
"--docs-share-url",
|
|
60
|
+
help="Deepset docs search share URL. Can also be set via DEEPSET_DOCS_SHARE_URL environment variable.",
|
|
61
|
+
),
|
|
62
|
+
] = None,
|
|
63
|
+
workspace_mode: Annotated[
|
|
64
|
+
WorkspaceMode,
|
|
65
|
+
typer.Option(
|
|
66
|
+
"--workspace-mode",
|
|
67
|
+
help="Whether workspace should be set statically or dynamically provided during a tool call.",
|
|
68
|
+
),
|
|
69
|
+
] = WorkspaceMode.STATIC,
|
|
70
|
+
tools: Annotated[
|
|
71
|
+
list[str] | None,
|
|
72
|
+
typer.Option(
|
|
73
|
+
"--tools",
|
|
74
|
+
help="Space-separated list of tools to register. If not specified, all available tools will be registered.",
|
|
75
|
+
),
|
|
76
|
+
] = None,
|
|
77
|
+
list_tools: Annotated[
|
|
78
|
+
bool,
|
|
79
|
+
typer.Option(
|
|
80
|
+
"--list-tools",
|
|
81
|
+
help="List all available tools and exit.",
|
|
82
|
+
),
|
|
83
|
+
] = False,
|
|
84
|
+
api_key_from_auth_header: Annotated[
|
|
85
|
+
bool,
|
|
86
|
+
typer.Option(
|
|
87
|
+
"--api-key-from-auth-header/--no-api-key-from-auth-header",
|
|
88
|
+
help="Get the deepset API key from the request's authorization header instead of using a static key.",
|
|
89
|
+
),
|
|
90
|
+
] = False,
|
|
91
|
+
transport: Annotated[
|
|
92
|
+
TransportEnum,
|
|
93
|
+
typer.Option(
|
|
94
|
+
"--transport",
|
|
95
|
+
help="The type of transport to use for running the MCP server.",
|
|
96
|
+
),
|
|
97
|
+
] = TransportEnum.STDIO,
|
|
98
|
+
object_store_backend: Annotated[
|
|
99
|
+
str | None,
|
|
100
|
+
typer.Option(
|
|
101
|
+
"--object-store-backend",
|
|
102
|
+
help="Object store backend type: 'memory' or 'redis'. "
|
|
103
|
+
"Can also be set via OBJECT_STORE_BACKEND environment variable. Default is 'memory'.",
|
|
104
|
+
),
|
|
105
|
+
] = None,
|
|
106
|
+
object_store_redis_url: Annotated[
|
|
107
|
+
str | None,
|
|
108
|
+
typer.Option(
|
|
109
|
+
"--object-store-redis-url",
|
|
110
|
+
help="Redis connection URL (e.g., redis://localhost:6379). "
|
|
111
|
+
"Can also be set via OBJECT_STORE_REDIS_URL environment variable.",
|
|
112
|
+
),
|
|
113
|
+
] = None,
|
|
114
|
+
object_store_ttl: Annotated[
|
|
115
|
+
int,
|
|
116
|
+
typer.Option(
|
|
117
|
+
"--object-store-ttl",
|
|
118
|
+
help="TTL in seconds for stored objects. Default: 600 (10 minutes). "
|
|
119
|
+
"Can also be set via OBJECT_STORE_TTL environment variable.",
|
|
120
|
+
),
|
|
121
|
+
] = 600,
|
|
122
|
+
) -> None:
|
|
123
|
+
"""
|
|
124
|
+
Run the Deepset MCP server.
|
|
125
|
+
|
|
126
|
+
The Deepset MCP server provides tools to interact with the deepset AI platform,
|
|
127
|
+
allowing you to create, debug, and learn about pipelines on the platform.
|
|
128
|
+
|
|
129
|
+
:param workspace: Deepset workspace name
|
|
130
|
+
:param api_key: Deepset API key for authentication
|
|
131
|
+
:param api_url: Deepset API base URL
|
|
132
|
+
:param docs_share_url: Deepset docs search share URL
|
|
133
|
+
:param workspace_mode: Whether workspace should be set statically or dynamically
|
|
134
|
+
:param tools: List of tools to register
|
|
135
|
+
:param list_tools: List all available tools and exit
|
|
136
|
+
:param api_key_from_auth_header: Get API key from authorization header
|
|
137
|
+
:param transport: Type of transport to use for the MCP server
|
|
138
|
+
:param object_store_backend: Object store backend type ('memory' or 'redis')
|
|
139
|
+
:param object_store_redis_url: Redis connection URL (required if backend='redis')
|
|
140
|
+
:param object_store_ttl: TTL in seconds for stored objects
|
|
141
|
+
"""
|
|
142
|
+
# Handle --list-tools flag early
|
|
143
|
+
if list_tools:
|
|
144
|
+
typer.echo("Available tools:")
|
|
145
|
+
for tool_name in sorted(TOOL_REGISTRY.keys()):
|
|
146
|
+
typer.echo(f" {tool_name}")
|
|
147
|
+
raise typer.Exit()
|
|
148
|
+
|
|
149
|
+
# Prefer command line arguments, fallback to environment variables
|
|
150
|
+
workspace = workspace or os.getenv("DEEPSET_WORKSPACE")
|
|
151
|
+
api_key = api_key or os.getenv("DEEPSET_API_KEY")
|
|
152
|
+
api_url = api_url or os.getenv("DEEPSET_API_URL")
|
|
153
|
+
docs_share_url = docs_share_url or os.getenv("DEEPSET_DOCS_SHARE_URL", DEEPSET_DOCS_DEFAULT_SHARE_URL)
|
|
154
|
+
|
|
155
|
+
# ObjectStore configuration
|
|
156
|
+
backend = str(object_store_backend or os.getenv("OBJECT_STORE_BACKEND", "memory"))
|
|
157
|
+
redis_url = object_store_redis_url or os.getenv("OBJECT_STORE_REDIS_URL")
|
|
158
|
+
ttl = int(os.getenv("OBJECT_STORE_TTL", str(object_store_ttl)))
|
|
159
|
+
|
|
160
|
+
if tools:
|
|
161
|
+
tool_names = set(tools)
|
|
162
|
+
else:
|
|
163
|
+
logging.info("Registering all available tools.")
|
|
164
|
+
tool_names = set(TOOL_REGISTRY.keys())
|
|
165
|
+
|
|
166
|
+
if api_key is None and not api_key_from_auth_header:
|
|
167
|
+
typer.echo(
|
|
168
|
+
"Error: API key is required. Either provide --api-key or use --api-key-from-auth-header "
|
|
169
|
+
"to fetch the API key from the authorization header.",
|
|
170
|
+
err=True,
|
|
171
|
+
)
|
|
172
|
+
raise typer.Exit(1)
|
|
173
|
+
|
|
174
|
+
if workspace_mode == WorkspaceMode.STATIC and not workspace:
|
|
175
|
+
typer.echo(
|
|
176
|
+
"Error: Workspace is required when using static workspace mode. "
|
|
177
|
+
"Set --workspace or DEEPSET_WORKSPACE environment variable.",
|
|
178
|
+
err=True,
|
|
179
|
+
)
|
|
180
|
+
raise typer.Exit(1)
|
|
181
|
+
|
|
182
|
+
if DOCS_SEARCH_TOOL_NAME in tool_names and docs_share_url is None:
|
|
183
|
+
typer.echo(
|
|
184
|
+
f"Error: {DOCS_SEARCH_TOOL_NAME} tool is requested but no docs share URL provided. "
|
|
185
|
+
"Set --docs-share-url or DEEPSET_DOCS_SHARE_URL environment variable.",
|
|
186
|
+
err=True,
|
|
187
|
+
)
|
|
188
|
+
raise typer.Exit(1)
|
|
189
|
+
|
|
190
|
+
mcp = FastMCP("deepset AI platform MCP server")
|
|
191
|
+
configure_mcp_server(
|
|
192
|
+
mcp_server_instance=mcp,
|
|
193
|
+
workspace_mode=workspace_mode,
|
|
194
|
+
deepset_api_key=api_key,
|
|
195
|
+
deepset_api_url=api_url,
|
|
196
|
+
deepset_workspace=workspace,
|
|
197
|
+
tools_to_register=tool_names,
|
|
198
|
+
deepset_docs_shareable_prototype_url=docs_share_url,
|
|
199
|
+
get_api_key_from_authorization_header=api_key_from_auth_header,
|
|
200
|
+
object_store_backend=backend,
|
|
201
|
+
object_store_redis_url=redis_url,
|
|
202
|
+
object_store_ttl=ttl,
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
mcp.run(transport=transport.value)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
if __name__ == "__main__":
|
|
209
|
+
app()
|
|
File without changes
|