remote-box-mcp-anthropic
Sample showing how to use the Box MCP hosted server with Anthropic's Messages API
GitHubスター
1
ユーザー評価
未評価
フォーク
0
イシュー
0
閲覧数
1
お気に入り
0
Box MCP Anthropic Chatbot
This project is a simple, interactive chatbot that uses the Anthropic API with a Box MCP (Model Context Protocol) server. It allows you to have a conversation with an Anthropic model, which has access to tools provided by the Box remote MCP server.
The chatbot runs in your terminal, maintains conversation history for context-aware responses, and uses asyncio
for asynchronous operation.
[!NOTE] Both the Box MCP remote server and the Anthropic Messages API used in this example are in beta. For the Box MCP server, reach out to your account team to inquire about access.
Features
- Interactive Chat: Have a real-time conversation with the AI in your terminal.
- Conversation History: The chatbot remembers previous turns in the conversation.
- Box MCP Integration: Connects to a Box MCP server to leverage its tools.
- Asynchronous: Built with Python's
asyncio
for efficient I/O.
Requirements
- Python 3.7+
- The
anthropic
Python library.
Configuration
Before running the chatbot, you need to configure your environment with the necessary credentials.
Install Dependencies: Install the required Python library using pip:
pip install -r requirements.txt
Set Environment Variables: This application requires two environment variables to be set:
ANTHROPIC_API_KEY
: Your API key for the Anthropic API.BOX_DEVELOPER_TOKEN
: Your developer token for authenticating with the Box MCP server.
You can set them in your terminal session like this:
On macOS/Linux:
export ANTHROPIC_API_KEY="your_anthropic_api_key" export BOX_DEVELOPER_TOKEN="your_box_developer_token"
On Windows (Command Prompt):
set ANTHROPIC_API_KEY="your_anthropic_api_key" set BOX_DEVELOPER_TOKEN="your_box_developer_token"
Note: For a more permanent solution, consider adding these export commands to your shell's startup file (e.g.,
.bashrc
,.zshrc
) or using a.env
file with a library likepython-dotenv
.
Usage
Once you have configured your environment variables, you can run the chatbot with the following command:
python main.py
The application will start, and you can begin typing your questions. To exit the chatbot, type quit
or exit
, or press Ctrl+C
.
Box Platform projects for and by the community. See @box for fully supported projects.
32
フォロワー
80
リポジトリ
0
Gist
1
貢献数