A Model Context Protocol (MCP) server for vector database operations, built with Go and designed to work seamlessly with the weave-cli tool.
Recent Updates: The server now supports both HTTP and stdio transports, includes an MCP Inspector for debugging and testing, comprehensive logging and monitoring capabilities, direct integration with weave-cli for code reuse, a complete CI/CD pipeline with automated testing and releases, document update functionality for flexible document management workflows, and full compatibility with Cursor 2.0's enhanced MCP interface.
- Dual Transport Support: HTTP and stdio MCP transports
- Vector Database Support: Weaviate, Milvus, and Mock databases
- MCP Tools: Complete set of tools for collection and document management
- MCP Inspector: Web-based debugging and testing interface
- Configuration: YAML + Environment Variables
- Testing: Comprehensive unit and integration tests with mocks
- Scripts: Build, start, stop, lint, and test automation
- Embedding Support: OpenAI and custom local embeddings
- Logging: Comprehensive file logging with monitoring tools
- Code Reuse: Direct integration with weave-cli for consistency
The Weave MCP Server supports two transport modes:
- Binary:
bin/weave-mcp - URL:
http://localhost:8030 - Use Case: Web applications, API integrations, testing
- Features: RESTful API endpoints, health checks, easy debugging
- Binary:
bin/weave-mcp-stdio - Transport: stdin/stdout communication
- Use Case: MCP clients like Claude Desktop, direct integration
- Features: Native MCP protocol, efficient communication, client integration
The server exposes the following MCP tools:
list_collections- List all collections in the vector databasecreate_collection- Create a new collection with specified schemadelete_collection- Delete a collection and all its documents
list_documents- List documents in a collection with paginationcreate_document- Create a new document in a collectionbatch_create_documents- Create multiple documents in a single batch operationget_document- Retrieve a specific document by IDupdate_document- Update a document's content or metadatadelete_document- Delete a document from a collectioncount_documents- Count documents in a collection
query_documents- Perform semantic search on documents
The MCP Inspector is a web-based debugging tool that provides a graphical interface for testing and exploring MCP tools. It's particularly useful for:
- Testing MCP Tools: Execute tools with custom parameters
- Debugging: See detailed request/response information
- Exploration: Discover available tools and their schemas
- Development: Rapid prototyping and testing
- Interactive Tool Testing: Execute any MCP tool with custom parameters
- Real-time Logging: See tool execution logs in real-time
- Schema Exploration: Browse available tools and their schemas
- Request/Response Inspection: Detailed view of MCP protocol messages
- Web Interface: Easy-to-use browser-based interface
Once started, the MCP Inspector is typically available at:
- Web Interface: http://localhost:6274 (with auth token)
- MCP Server: http://localhost:8030
The inspector uses the official npx @modelcontextprotocol/inspector method
and is configured to connect to the Weave MCP Server using the configuration
in tools/mcp-inspector-config.json. This file is created during setup and
includes:
- Server connection details
- Environment variable mapping
- Tool configuration
- Go 1.21 or later
- Vector database (Weaviate, Milvus, or use mock for testing)
- Clone the repository:
git clone https://github.com/maximilien/weave-mcp.git
cd weave-mcp- Run the setup script (installs MCP Inspector and builds servers):
./setup.sh- Configure the server:
cp config.yaml.example config.yaml
cp .env.example .env
# Edit config.yaml and .env with your settingsManual Installation (if setup script fails):
# Install Go dependencies
go mod tidy
# Build servers
./build.shThe MCP Inspector provides a web-based interface for testing and debugging MCP tools. To set it up:
# Install MCP Inspector and dependencies
./setup.shThis will:
- Install Node.js dependencies (if not already installed)
- Clone the MCP Inspector repository
- Install inspector dependencies
- Create inspector configuration
- Build the MCP server
Prerequisites for MCP Inspector:
- Node.js 22.7.5+ (required for MCP Inspector)
- npm (comes with Node.js)
Note: MCP Inspector requires Node.js 22.7.5 or later. If you have an older version, the setup script will skip the inspector installation but continue with the server setup.
# Build both HTTP and stdio servers
./build.sh
# Build only HTTP server
./build.sh http
# Build only stdio server
./build.sh stdioThis will:
- Download Go dependencies
- Run tests
- Build the MCP server binaries (HTTP and/or stdio)
- Create build information
# Start HTTP server in foreground
./start.sh http
# Start HTTP server as daemon
./start.sh http --daemon# Show stdio server configuration for MCP clients
./start.sh stdio# Start inspector (will start HTTP server if not running)
./start.sh inspector
# Or start both HTTP server and inspector together
./start.sh both# Stop HTTP server
./stop.sh http
# Stop stdio server (if running)
./stop.sh stdio
# Stop inspector
./stop.sh inspector
# Stop all services
./stop.sh all
# Check status
./stop.sh statusFor stdio server integration with MCP clients like Cursor 2.0, Claude Desktop, and other MCP-compatible clients:
# Show stdio server configuration
./start.sh stdioFor Cursor 2.0:
Add this configuration to your Cursor MCP settings (typically in
~/.cursor/mcp.json or via Cursor Settings):
{
"mcpServers": {
"weave-mcp": {
"command": "/path/to/weave-mcp/bin/weave-mcp-stdio",
"args": []
}
}
}For Claude Desktop:
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"weave-mcp": {
"command": "/path/to/weave-mcp/bin/weave-mcp-stdio",
"args": []
}
}
}Note: The server is now compatible with Cursor 2.0's enhanced MCP interface and uses MCP SDK v1.1.0 for optimal compatibility.
# Monitor all logs
./tools/tail-logs.sh
# Monitor HTTP server logs only
./tools/tail-logs.sh mcp
# Monitor stdio server logs only
./tools/tail-logs.sh stdio
# Monitor MCP Inspector logs only
./tools/tail-logs.sh inspectorRun all tests:
./test.shRun specific test types:
./test.sh unit # Unit tests only
./test.sh integration # Integration tests only
./test.sh fast # Fast tests (unit + mock integration)
./test.sh coverage # Tests with coverage reportCheck code quality:
./lint.shCreate a .env file with the following variables:
# Vector Database Configuration
VECTOR_DB_TYPE=weaviate-cloud
# Weaviate Cloud Configuration
WEAVIATE_URL=https://your-cluster-url.weaviate.network
WEAVIATE_API_KEY=your-weaviate-api-key
OPENAI_API_KEY=your-openai-api-key
# Collection Names
WEAVIATE_COLLECTION=WeaveDocs
WEAVIATE_COLLECTION_IMAGES=WeaveImages
# MCP Server Configuration
MCP_SERVER_HOST=localhost
MCP_SERVER_PORT=8030The config.yaml file supports multiple database configurations:
databases:
default: weaviate-cloud
vector_databases:
- name: weaviate-cloud
type: weaviate-cloud
url: ${WEAVIATE_URL}
api_key: ${WEAVIATE_API_KEY}
openai_api_key: ${OPENAI_API_KEY}
collections:
- name: WeaveDocs
type: text
description: Main text documents collection
- name: WeaveImages
type: image
description: Image documents collection
- name: mock
type: mock
enabled: true
simulate_embeddings: true
embedding_dimension: 384
collections:
- name: WeaveDocs
type: text
description: Mock text documents collectionThe MCP server exposes the following HTTP endpoints:
GET /health- Health check (includes database status)GET /mcp/tools/list- List available MCP toolsPOST /mcp/tools/call- Execute an MCP tool
curl http://localhost:8030/healthReturns:
{
"status": "healthy",
"timestamp": "2025-11-14T19:22:26Z",
"database": {
"status": "healthy",
"type": "weaviate-cloud",
"name": "weaviate-cloud"
}
}Returns HTTP 503 if database is unhealthy.
curl http://localhost:8030/mcp/tools/listcurl -X POST http://localhost:8030/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "list_collections",
"arguments": {}
}'curl -X POST http://localhost:8030/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "create_collection",
"arguments": {
"name": "MyCollection",
"type": "text",
"description": "My test collection"
}
}'curl -X POST http://localhost:8030/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "create_document",
"arguments": {
"collection": "MyCollection",
"url": "https://example.com/doc1",
"text": "This is a test document",
"metadata": {
"type": "test",
"author": "user"
}
}
}'curl -X POST http://localhost:8030/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "update_document",
"arguments": {
"collection": "MyCollection",
"document_id": "document-id-123",
"content": "Updated document content",
"metadata": {
"updated_by": "user",
"last_modified": "2025-01-09"
}
}
}'curl -X POST http://localhost:8030/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "query_documents",
"arguments": {
"collection": "MyCollection",
"query": "test document",
"limit": 5
}
}'The Weave MCP Server includes comprehensive logging and monitoring capabilities.
- Location:
./logs/weave-mcp.log - Format: Structured JSON with timestamps and caller information
- Output: Both console and file logging simultaneously
- Auto-creation: Logs directory is created automatically on startup
Use the ./tools/tail-logs.sh script to monitor logs in real-time:
./tools/tail-logs.sh all./tools/tail-logs.sh mcp./tools/tail-logs.sh status./tools/tail-logs.sh recent./tools/tail-logs.sh help- Real-time monitoring: Tail logs as they're written
- Service status: Check if MCP server is running
- Color-coded output: Easy to read with syntax highlighting
- System integration: Includes system logs for comprehensive monitoring
- Multiple modes: Different monitoring options for different needs
{
"level": "info",
"ts": 1759848440.371797,
"caller": "src/main.go:87",
"msg": "Starting Weave MCP Server",
"address": "localhost:8030",
"version": "0.0.6",
"git_commit": "da2f207"
}
{
"level": "info",
"ts": 1759848441.123456,
"caller": "src/main.go:95",
"msg": "MCP server started successfully"
}
{
"level": "info",
"ts": 1759848442.789012,
"caller": "src/pkg/mcp/handlers.go:45",
"msg": "Tool called",
"tool": "list_collections",
"collection": "WeaveDocs"
}weave-mcp/
├── src/
│ ├── main.go # HTTP server entry point
│ ├── cmd/
│ │ └── stdio/
│ │ └── main.go # stdio server entry point
│ └── pkg/
│ ├── config/ # Configuration management
│ ├── mcp/ # MCP server implementation
│ ├── weaviate/ # Weaviate client (from weave-cli)
│ ├── milvus/ # Milvus client
│ ├── mock/ # Mock client for testing
│ └── version/ # Version information
├── tests/ # Test files
├── tools/ # Utility scripts
│ ├── tail-logs.sh # Log monitoring script
│ └── mcp-inspector-config.json # MCP Inspector configuration
├── logs/ # Log files directory
│ └── .gitkeep # Preserve directory in git
├── schemas/ # Collection schemas
├── bin/ # Built binaries
│ ├── weave-mcp # HTTP server binary
│ └── weave-mcp-stdio # stdio server binary
├── config.yaml # Configuration file
├── .env # Environment variables
├── setup.sh # Setup script (MCP Inspector + build)
├── build.sh # Build script
├── start.sh # Start script
├── stop.sh # Stop script
├── test.sh # Test script
└── lint.sh # Lint script
To add a new MCP tool:
- Add the tool definition in
src/pkg/mcp/server.go:
s.registerTool(Tool{
Name: "my_new_tool",
Description: "Description of my new tool",
InputSchema: map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"param1": map[string]interface{}{
"type": "string",
"description": "Parameter description",
},
},
"required": []string{"param1"},
},
Handler: s.handleMyNewTool,
})- Implement the handler in
src/pkg/mcp/handlers.go:
func (s *Server) handleMyNewTool(ctx context.Context,
args map[string]interface{}) (interface{}, error) {
// Implementation here
return result, nil
}- Add tests in
tests/mcp_test.go
To add support for a new vector database:
- Create a new client package in
src/pkg/ - Implement the database interface
- Update the MCP server to support the new database type
- Add configuration support
- Add tests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite:
./test.sh - Run the linter:
./lint.sh - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- weave-cli - Command-line tool for vector database operations
- Model Context Protocol - MCP specification and SDKs
For issues and questions:
- Check the Issues page
- Create a new issue with detailed information
- Include logs and configuration details
- Changelog - Complete version history and release notes
- Troubleshooting Guide - Common issues and solutions
- GitHub Releases - Download releases