dtlpymcp 0.1.12__tar.gz → 0.1.14__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.
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/PKG-INFO +1 -1
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp/__init__.py +1 -1
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp/utils/dtlpy_context.py +1 -2
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/PKG-INFO +1 -1
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/SOURCES.txt +1 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/pyproject.toml +1 -1
- dtlpymcp-0.1.14/tests/test_dlchat.py +36 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/MANIFEST.in +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/README.md +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp/__main__.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp/min_proxy.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp/proxy.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/dependency_links.txt +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/entry_points.txt +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/requires.txt +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/dtlpymcp.egg-info/top_level.txt +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/setup.cfg +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/tests/test_context.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/tests/test_custom_sources_file.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/tests/test_list_platform_tools.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/tests/test_proxy.py +0 -0
- {dtlpymcp-0.1.12 → dtlpymcp-0.1.14}/tests/test_run.py +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from imp import source_from_cache
|
|
2
1
|
from mcp.server.fastmcp.utilities.func_metadata import ArgModelBase, FuncMetadata
|
|
3
2
|
from mcp.client.streamable_http import streamablehttp_client
|
|
4
3
|
from typing import List, Tuple, Callable, Optional
|
|
@@ -96,7 +95,7 @@ class DataloopContext:
|
|
|
96
95
|
server_name, tools, call_fn = result
|
|
97
96
|
for tool in tools.tools:
|
|
98
97
|
tool_name = tool.name
|
|
99
|
-
ns_tool_name = f"{server_name}
|
|
98
|
+
ns_tool_name = f"{server_name}__{tool_name}"
|
|
100
99
|
description = tool.description
|
|
101
100
|
input_schema = tool.inputSchema
|
|
102
101
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import random
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
from datetime import timedelta
|
|
6
|
+
from mcp.client.stdio import stdio_client
|
|
7
|
+
from mcp import ClientSession, StdioServerParameters
|
|
8
|
+
import dtlpy as dl
|
|
9
|
+
|
|
10
|
+
dl.setenv('prod')
|
|
11
|
+
if dl.token_expired():
|
|
12
|
+
dl.login()
|
|
13
|
+
|
|
14
|
+
# Create server parameters for stdio connection
|
|
15
|
+
server_params = StdioServerParameters(
|
|
16
|
+
command="e:\\Applications\\dtlpy-mcp\\.venv\\Scripts\\python.exe", # Executable
|
|
17
|
+
args=["-m", "dtlpymcp", "start", "-s", "tests/assets/sources.json"], # Command line arguments
|
|
18
|
+
env={"DATALOOP_API_KEY": dl.token()}, # Optional environment variables
|
|
19
|
+
cwd=os.getcwd()
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
async def test_health_check():
|
|
23
|
+
print("[TEST CLIENT] Connecting to MCP server and calling test tool...")
|
|
24
|
+
async with stdio_client(server=server_params) as (read, write):
|
|
25
|
+
async with ClientSession(read, write, read_timeout_seconds=timedelta(seconds=60)) as session:
|
|
26
|
+
await session.initialize()
|
|
27
|
+
tools = await session.list_tools()
|
|
28
|
+
print([tool.name for tool in tools.tools])
|
|
29
|
+
tool_result = await session.call_tool("dl-internal-chat-prod__list_repos")
|
|
30
|
+
print("[RESULT]", tool_result)
|
|
31
|
+
tool_result = await session.call_tool("dl-internal-chat-prod__ping")
|
|
32
|
+
print("[RESULT]", tool_result)
|
|
33
|
+
|
|
34
|
+
if __name__ == "__main__":
|
|
35
|
+
asyncio.run(test_health_check())
|
|
36
|
+
# asyncio.run(test_ask_dataloop())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|