Skip to content

box-community/remote-box-mcp-anthropic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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.

  1. Install Dependencies: Install the required Python library using pip:

    pip install -r requirements.txt
  2. 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 like python-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.

About

Sample showing how to use the Box MCP hosted server with Anthropic's Messages API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages