Skip to content

Commit bc41ddd

Browse files
committed
Release v0.1.1: Fix executable name and update configuration
- Change executable name from camel-terminal-mcp to terminal-toolkit-mcp - Update README.md with new executable name - Update examples to use simplified configuration - Fix MCP client configuration to work with uvx terminal-toolkit-mcp
1 parent 05e1265 commit bc41ddd

File tree

3 files changed

+100
-5
lines changed

3 files changed

+100
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pip install -e .
3636
Start the server with stdio transport:
3737

3838
```bash
39-
camel-terminal-mcp
39+
terminal-toolkit-mcp
4040
```
4141

4242
### Command Line Options
@@ -51,10 +51,10 @@ camel-terminal-mcp
5151

5252
```bash
5353
# Start with custom working directory and increased timeout
54-
camel-terminal-mcp --working-directory /tmp/workspace --timeout 60.0
54+
terminal-toolkit-mcp --working-directory /tmp/workspace --timeout 60.0
5555

5656
# Start with safe mode disabled (not recommended)
57-
camel-terminal-mcp --no-safe-mode
57+
terminal-toolkit-mcp --no-safe-mode
5858
```
5959

6060
## Available Tools

examples/camel-client.py

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14+
"""MCP Server Example
15+
16+
This example demonstrates how to use the MCP (Managed Code Processing) server
17+
with CAMEL agents for file operations.
18+
19+
Setup:
20+
1. Install Node.js and npm
21+
22+
2. Install MCP filesystem server globally:
23+
```bash
24+
npm install -g @modelcontextprotocol/server-filesystem
25+
```
26+
27+
Usage:
28+
1. Run this script to start an MCP filesystem server
29+
2. The server will only operate within the specified directory
30+
3. All paths in responses will be relative to maintain privacy
31+
"""
32+
33+
import asyncio
34+
from pathlib import Path
35+
36+
from camel.agents import ChatAgent
37+
from camel.models import ModelFactory
38+
from camel.toolkits import MCPToolkit
39+
from camel.types import ModelPlatformType, ModelType
40+
from camel.utils.mcp_client import MCPClient
41+
42+
43+
async def mcp_client_example():
44+
config = {
45+
"command": "uvx",
46+
"args": ["terminal-toolkit-mcp"],
47+
}
48+
async with MCPClient(config) as client:
49+
mcp_tools = await client.list_mcp_tools()
50+
print("Available MCP tools:", [tool.name for tool in mcp_tools.tools])
51+
# Use shell_exec to list directory contents instead
52+
call_tool_result = await client.call_tool(
53+
"shell_exec", {"id": "main", "command": "ls -la"}
54+
)
55+
print("Directory Contents:")
56+
print(call_tool_result.content[0].text)
57+
58+
59+
60+
61+
62+
async def mcp_toolkit_example():
63+
# Use either config path or config dict to initialize the MCP toolkit.
64+
# 1. Use config path:
65+
config = {
66+
"mcpServers": {
67+
"terminal-toolkit-mcp": {
68+
"command": "uvx",
69+
"args": ["terminal-toolkit-mcp"],
70+
}
71+
}
72+
}
73+
74+
# Connect to all MCP servers.
75+
async with MCPToolkit(config=config) as mcp_toolkit:
76+
sys_msg = "You are a helpful assistant"
77+
model = ModelFactory.create(
78+
model_platform=ModelPlatformType.DEFAULT,
79+
model_type=ModelType.DEFAULT,
80+
)
81+
camel_agent = ChatAgent(
82+
system_message=sys_msg,
83+
model=model,
84+
tools=[*mcp_toolkit.get_tools()],
85+
)
86+
user_msg = "Use terminal-toolkit-mcp to list 5 files in the project, using relative paths"
87+
response = await camel_agent.astep(user_msg)
88+
print(response.msgs[0].content)
89+
print(response.info['tool_calls'])
90+
91+
92+
if __name__ == "__main__":
93+
asyncio.run(mcp_client_example())
94+
# asyncio.run(mcp_toolkit_example())
95+

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "terminal-toolkit-mcp"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "CAMEL Terminal Toolkit as a standalone MCP server"
99
authors = [
1010
{name = "CAMEL-AI.org", email = "[email protected]"}
@@ -45,7 +45,7 @@ dev = [
4545
]
4646

4747
[project.scripts]
48-
camel-terminal-mcp = "camel_terminal_toolkit.server:main"
48+
terminal-toolkit-mcp = "camel_terminal_toolkit.server:main"
4949

5050
[project.urls]
5151
Homepage = "https://github.com/camel-ai/terminal-toolkit-mcp"

0 commit comments

Comments
 (0)