Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดAn interactive command-line chatbot for Google Cloud Vertex AI, supporting both Anthropic's Claude and Google Gemini models. Choose your preferred AI provider with a simple flag. The chatbot features full MCP (Model Context Protocol) integration with Claude, allowing autonomous tool discovery and execution during conversations. Supports Vertex AI or direct Anthropic API access, with automatic tool calling, multi-turn conversations, and comprehensive error handling.
--provider flagmcp_config.json with automatic tool discovery and executionThe chatbot includes comprehensive MCP (Model Context Protocol) support:
# 1. Clone and setup
git clone https://github.com/intertwine/vertex-mcp-chatbot.git
cd vertex-mcp-chatbot
make setup # Install dependencies and create .env
# 2. Configure (edit .env file with your GCP project settings)
nano .env # or use your preferred editor
# 3. Authenticate and run
make auth # Authenticate with Google Cloud
make run # Start the chatbot with quiet MCP logging!
For all available commands, run:
make help
gcloud) installed and authenticatedgit clone https://github.com/intertwine/vertex-mcp-chatbot.git
cd vertex-mcp-chatbot
make setup
This runs
uv syncand copies.env.exampleto.env
.env to override default project settings:GOOGLE_CLOUD_PROJECT='your-gcp-project-id'
GOOGLE_CLOUD_LOCATION='us-east1'
make auth
This runs
gcloud auth application-default login
Alternative manual setup:
# Install dependencies manually
uv sync
# Copy environment file
cp .env.example .env
# Authenticate manually
gcloud auth application-default login
Start the chatbot with the default provider (Claude):
make run
Use Claude (default):
make run # Uses Claude Sonnet 4.5 (quiet MCP logging)
make run-claude # Same as above (quiet MCP logging)
make run-opus # Uses Claude Opus 4.1 (quiet MCP logging)
make run-haiku # Uses Claude Haiku 4.5 (quiet MCP logging)
Use Gemini:
make run-gemini # Uses Gemini 2.5 Flash (quiet MCP logging)
make run-gemini-pro # Uses Gemini 2.5 Pro (quiet MCP logging)
With verbose logging:
make run-verbose # Claude with INFO-level MCP logging
make run-debug # Claude with DEBUG-level MCP logging
Alternative (direct uv commands):
uv run main.py # Claude Sonnet 4.5 (default)
uv run main.py --model claude-opus-4-1-20250805 # Claude Opus
uv run main.py --model claude-haiku-4-5 # Claude Haiku 4.5
uv run main.py --provider gemini # Gemini 2.5 Flash
uv run main.py --provider gemini --model gemini-2.5-pro # Gemini 2.5 Pro
# Logging control options
uv run main.py --quiet-mcp # Suppress MCP server info logging
uv run main.py --log-level DEBUG # Show detailed MCP debug information
uv run main.py --log-level ERROR # Only show errors from MCP operations
Key Differences:
Both providers offer the same intuitive terminal interface, markdown rendering, and persistent conversation history.
The CLI automatically attempts to run Claude through Google Cloud Vertex AI using Application Default Credentials. To customise the behaviour, set any of the following environment variables before launching the REPL (they can be stored in .env):
CLAUDE_VERTEX_ENABLED – set to false to fall back to the public Anthropic API (requires ANTHROPIC_API_KEY)CLAUDE_VERTEX_PROJECT – override the GCP project used for billing (GOOGLE_CLOUD_PROJECT is used otherwise)CLAUDE_VERTEX_LOCATION – override the Vertex region (defaults to GOOGLE_CLOUD_LOCATION or us-east1)CLAUDE_VERTEX_BASE_URL – fully override the Vertex endpoint if you need to point at a proxyCLAUDE_MODEL – override the default Claude model (default: claude-sonnet-4-5-20250929)CLAUDE_API_VERSION – override the Anthropic API version header (default: 2023-06-01)See docs/claude-agent.md for an end-to-end walkthrough that covers authentication, MCP configuration, and troubleshooting tips when connecting Claude through Vertex AI, plus guidance on when to prefer the legacy Gemini provider.
To use MCP features, create an mcp_config.json file in the project root. See the MCP User Guide for detailed configuration instructions and examples.
When you connect to an MCP server, Claude automatically sees available tools and can use them during conversations:
You > /mcp connect filesystem
✅ Connected to MCP server: filesystem
You > Please list the files in the current directory
Claude: The current directory contains the following files:
1. CODE_OF_CONDUCT.md (1.3 KB)
2. pyproject.toml (1.9 KB) - Python project configuration
3. README.md (24.6 KB) - Project documentation
4. main.py (1.7 KB) - Main Python script
...
Claude automatically:
list_files tool from the connected MCP serverNo explicit tool invocation needed - Claude autonomously chooses when and how to use tools!
Note: The default make run targets now use --quiet-mcp for cleaner output. Use make run-verbose or make run-debug if you need more detailed logging.
The chatbot provides options to control the verbosity of MCP server logging:
Suppress MCP logging (quiet mode):
uv run main.py --quiet-mcp
This suppresses all informational logging from MCP operations, showing only errors.
Adjust logging level:
uv run main.py --log-level DEBUG # Show detailed debug information
uv run main.py --log-level INFO # Show informational messages
uv run main.py --log-level WARNING # Default - show warnings and above
uv run main.py --log-level ERROR # Show only errors
uv run main.py --log-level CRITICAL # Show only critical errors
These options are useful when:
--quiet-mcp)--log-level DEBUG)--log-level ERROR)When responses or content are too long for your terminal, the chatbot automatically switches to a scrollable view:
Navigation Controls:
Features:
/history command/mcp tools listings/mcp resources listings/mcp prompts listingsWhile chatting, you can use these commands:
/help - Show available commands and tips/clear - Clear the chat history and start fresh (resets the Claude session)/history - Display the full conversation history with markdown rendering/system <prompt> - Update the system instruction and restart the Claude agent/quit - Exit the chatbotMCP Commands (when MCP is available):
/mcp connect <server> - Connect to an MCP server from your config/mcp list - Show configured servers and their connection status/mcp disconnect <server> - Disconnect from an MCP server/mcp tools - Show available tools from all connected servers/mcp resources - Show available resources from all connected servers/mcp prompts - List available prompt templates from all connected servers/mcp prompt <name> - Use a specific prompt templateWhen MCP servers are connected, their tools become automatically available during conversations. Claude will intelligently use these tools when appropriate to help answer your questions or perform tasks. You don't need to use special syntax - just chat naturally and Claude will:
For example, if you have a weather MCP server connected and ask "What's the weather like?", Claude will automatically use the weather tool to get current conditions.
MCP resources are automatically read when you reference them by URI in your messages. This allows you to seamlessly include external data in your conversations with Claude:
file:///path/to/data.json or http://example.com/api/dataExample:
You> Can you analyze the data in file:///home/user/sales_report.csv?
[The chatbot automatically reads the CSV file and includes its content in the prompt to Claude,
who can then analyze and discuss the data]
MCP servers can provide prompt templates that help structure interactions for specific tasks. These templates make it easy to perform complex operations with consistent formatting:
/mcp prompts to see all available templates/mcp prompt <template_name> to apply a templateExample:
You> /mcp prompts
Available prompts from code-analyzer:
- analyze_function: Analyze a function for complexity and suggest improvements
- review_pr: Review pull request changes and provide feedback
- explain_code: Explain how a piece of code works in simple terms
You> /mcp prompt analyze_function
Enter value for 'function_name': calculateTotalPrice
Enter value for 'context': This function processes shopping cart items
[The template is filled with your values and sent to Claude, who provides
a detailed analysis of the function based on the structured prompt]
🚀 Starting Claude Agent REPL...
✅ Ready!
You> What is machine learning?
╭─ Claude ─────────────────────────────────────────────╮
│ │
│ Machine learning (ML) is a branch of artificial │
│ intelligence focused on building systems that can │
│ learn from data and improve their performance over │
│ time without being explicitly programmed for every │
│ scenario... │
│ │
╰──────────────────────────────────────────────────────╯
You> /system You are a patient tutor for high-school students.
System prompt updated.
You> Explain overfitting in one paragraph.
╭─ Claude ─────────────────────────────────────────────╮
│ │
│ Overfitting happens when a model memorises the │
│ training data instead of learning the underlying │
│ patterns, so it performs well on the data it has │
│ seen but poorly on new examples. A simple way to │
│ picture it is a student who only studies past exam │
│ answers: they may ace the practice questions yet │
│ struggle when the real test words things slightly │
│ differently. │
│ │
╰──────────────────────────────────────────────────────╯
You> /quit
👋 Goodbye!
Create an mcp_config.json file in the project root:
{
"servers": [
{
"name": "filesystem",
"transport": "stdio",
"command": ["python", "examples/mcp-servers/filesystem_server.py"]
},
{
"name": "weather-api",
"transport": "http",
"url": "http://localhost:8080/mcp",
"auth": {
"type": "basic",
"username": "user",
"password": "pass"
}
}
]
}
The MCP configuration supports environment variable substitution using ${VAR_NAME} syntax. Variables are automatically loaded from your .env file:
# .env file
API_KEY=your-secret-key
OAUTH_CLIENT_SECRET=your-oauth-secret
{
"servers": [
{
"name": "api-server",
"transport": "http",
"url": "https://api.example.com",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
]
}
You can also provide default values with ${VAR_NAME:-default} syntax.
{
"name": "github-api",
"transport": "http",
"url": "https://api.github.com/mcp",
"auth": {
"type": "oauth",
"authorization_url": "https://github.com/login/oauth/authorize",
"token_url": "https://github.com/login/oauth/access_token",
"client_id": "your-client-id",
"client_secret": "${OAUTH_CLIENT_SECRET}",
"scope": "repo read:user",
"redirect_uri": "http://localhost:8080/callback"
}
}
{
"name": "flaky-server",
"transport": "stdio",
"command": ["node", "server.js"],
"retry": {
"max_attempts": 5,
"initial_delay": 1.0,
"max_delay": 30.0,
"exponential_base": 2.0,
"jitter": true
}
}
When multiple servers offer similar tools, use priority to control which server is preferred:
{
"servers": [
{
"name": "primary-calc",
"transport": "stdio",
"command": ["python", "calc_server.py"],
"priority": 1
},
{
"name": "backup-calc",
"transport": "http",
"url": "http://backup.example.com/mcp",
"priority": 2
}
]
}
The project includes example MCP servers in examples/mcp-servers/:
See examples/README.md for detailed setup instructions.
vertex-mcp-chatbot/
├── main.py # Entry point
├── pyproject.toml # Python project configuration and dependencies
├── pytest.ini # Pytest configuration
├── scripts/
│ ├── run_tests.py # Custom test runner script
│ └── run_example_tests.py # Example server test runner
├── .env.example # Example environment file
├── .gitignore # Git ignore rules
├── README.md # This file
├── mcp_config.json.example # Example MCP server configuration
├── docs/
│ ├── claude-agent.md # Claude Agent SDK + Vertex AI walkthrough
│ └── mcp-guide.md # Comprehensive MCP user guide
├── src/
│ ├── __init__.py # Package init
│ ├── claude_agent_chatbot.py # Claude Agent REPL (default CLI)
│ ├── claude_agent_client.py # Claude SDK helper / session manager
│ ├── claude_sdk_fallback.py # Local stub used in tests when SDK is unavailable
│ ├── config.py # Configuration management for Claude + Gemini helpers
│ ├── gemini_client.py # Legacy Gemini/Vertex AI client wrapper (still used in tests)
│ ├── chatbot.py # Legacy Gemini chatbot implementation
│ ├── mcp_config.py # MCP configuration handling
│ └── mcp_manager.py # MCP client management
└── tests/
├── __init__.py # Test package init
├── conftest.py # Pytest fixtures and configuration
├── test_config.py # Configuration tests
├── test_gemini_client.py # Gemini client tests
├── test_chatbot.py # Legacy Gemini chatbot functionality tests
├── test_claude_agent_chatbot.py # Claude REPL behaviour
├── test_claude_agent_client.py # Claude client helper tests
├── test_main.py # Main entry point tests
├── test_integration.py # Integration tests
├── test_mcp_config.py # MCP configuration tests
├── test_mcp_manager.py # MCP manager tests
├── test_mcp_http_transport.py # HTTP/SSE transport tests
├── test_mcp_multi_server.py # Multi-server coordination tests
├── test_mcp_oauth.py # OAuth authentication tests
└── test_mcp_retry.py # Connection retry tests
The application uses the following configuration (can be modified in src/config.py):
your-gcp-project-id (override in .env via GOOGLE_CLOUD_PROJECT)your-gcp-location (override in .env via GOOGLE_CLOUD_LOCATION)claude-4.5-sonnet (change via CLAUDE_MODEL)2025-02-19 (set CLAUDE_API_VERSION to override)Make sure you've:
gcloud auth application-default loginVertex AI User role to the identity running the CLIuv sync or pip install -e .) so google-auth is availableCheck that:
gcloud auth application-default login or service account JSON)GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION values match your deploymentIf Vertex access is unavailable you can still run the REPL by setting CLAUDE_VERTEX_ENABLED=false and exporting ANTHROPIC_API_KEY. The helper automatically reconfigures the Claude SDK to use the public endpoint and keeps MCP tooling enabled.
This project includes a comprehensive test suite with 190+ tests covering all functionality, including example MCP servers.
Quick test run:
# Install dev dependencies (includes pytest-cov for coverage)
make install-dev
# Run all tests
make test
Testing commands:
make test # Run all tests with pytest
make test-v # Run tests with verbose output
make test-cov # Run tests with coverage report
make test-unit # Run only unit tests
make test-int # Run only integration tests
Example MCP Server Tests:
make test-examples # Run all example server tests
make test-examples-v # Run with verbose output
make test-examples-cov # Run with coverage
make test-filesystem # Run only filesystem server tests
make test-weather # Run only weather server tests
make server-check # Check server health
Alternative (direct uv commands):
# Run all tests
uv run pytest tests/ -v
# Using the custom test runner
uv run python scripts/run_tests.py --verbose
uv run python scripts/run_tests.py --coverage
uv run python scripts/run_tests.py --unit
# Example server tests
uv run python scripts/run_example_tests.py --filesystem
uv run python scripts/run_example_tests.py --weather
Unit Tests:
test_config.py - Configuration management (6 tests)test_claude_agent_client.py - Claude Agent client helper (6 tests)test_claude_agent_chatbot.py - Claude REPL commands and history (7 tests)test_gemini_client.py - Gemini API client functionality (11 tests)test_chatbot.py - Interactive chatbot features (23 tests)test_main.py - Main entry point and CLI (8 tests)MCP Framework Tests:
test_mcp_manager.py - MCP client management (25+ tests)test_mcp_config.py - MCP configuration handling (15+ tests)test_mcp_http_transport.py - HTTP/SSE transport tests (20+ tests)test_mcp_multi_server.py - Multi-server coordination (15+ tests)test_mcp_oauth.py - OAuth authentication (20+ tests)test_mcp_retry.py - Connection retry logic (10+ tests)Example Server Tests:
test_filesystem_server.py - Filesystem MCP server (44 tests)test_weather_server.py - Weather MCP server (39 tests)Integration Tests:
test_integration.py - Full system integration scenariosThe test suite covers:
conftest.pyTo extend or modify the chatbot:
ClaudeAgentClient (src/claude_agent_client.py) - Creates Claude agents/sessions and sends messagesClaudeAgentChatbot (src/claude_agent_chatbot.py) - Terminal UI that wraps the Claude Agent SDKConfig (src/config.py) - Centralised configuration management for Claude and Gemini helpersmain.py - Entry point and CLI argument handlingsrc/gemini_client.py, src/chatbot.py) - Retained for backwards compatibility and testsClaudeAgentChatbot.handle_command for CLI additionsConfig classClaudeAgentClient (or the fallback stub) for advanced SDK usageClaudeAgentChatbot# Set up development environment
make dev-setup # Installs deps + pre-commit hooks
# Run tests during development
make test # Run all tests
make test-cov # Run with coverage report
# Code quality
make format # Format code with black and isort
make lint # Run flake8 linting
make pre-commit-run # Run all pre-commit hooks
# Dependency management
make add PKG=requests # Add a new dependency
make add-dev PKG=pytest # Add a dev dependency
make sync # Sync dependencies from pyproject.toml
# Clean up
make clean # Remove Python cache files
make clean-all # Remove cache + virtual environment
Alternative (direct uv commands):
uv sync --extra dev
uv run pre-commit install
uv run pytest tests/ -v --tb=short
uv run black src/ tests/
uv run isort src/ tests/
uv run flake8 src/ tests/
When adding new functionality:
tests/conftest.py for common mocking.env file or service account credentials.gitignore file is configured to exclude sensitive filesMIT License. See LICENSE for details.
Vertex AI chatbot with MCP integration
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Vertex MCP Chatbot ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-10-28 Vertex AI chatbot with MCP integration