loading…
Search for a command to run...
loading…
A Julia-based MCP server providing tools for database operations, file management, and database administration, with HTTP bridge support for Windows Claude Desk
A Julia-based MCP server providing tools for database operations, file management, and database administration, with HTTP bridge support for Windows Claude Desktop integration.
A Model Context Protocol (MCP) server implementation in Julia that provides tools for AI agents to interact with.
✅ VERIFIED WORKING: Successfully tested with Claude Desktop on Windows via WSL with full Node.js MCP wrapper integration.
This project implements an MCP server following the JSON-RPC 2.0 specification over stdio transport. It provides a framework for creating custom tools that can be called by AI agents like Claude Code. Features complete Windows Claude Desktop integration via HTTP bridge and Node.js MCP wrapper.
/mcp/docsjulia_mcp_server/
├── Project.toml # Julia project configuration
├── src/
│ ├── JuliaMCPServer.jl # Main module
│ ├── jsonrpc.jl # JSON-RPC implementation
│ ├── mcp.jl # MCP protocol handlers
│ └── server.jl # Server runtime
├── example.jl # Example server with sample tools
├── file_server_example.jl # File server with filesystem tools
├── postgres_example.jl # PostgreSQL database server
├── db_admin_example.jl # Database administration server
├── test_mcp.jl # Test utilities
└── README.md
One-line installation and setup:
curl -fsSL https://raw.githubusercontent.com/SerenaMichaels/MCPJuliaServer/main/scripts/install.sh | bash
Configure Claude Desktop:
./claude_config/setup_claude_config.sh
Start servers automatically (optional):
sudo ./scripts/setup-services.sh
If you're running Claude Desktop on Windows but want to use MCP servers in WSL:
In WSL - Install and setup servers:
# Install the MCP servers in WSL
curl -fsSL https://raw.githubusercontent.com/SerenaMichaels/MCPJuliaServer/main/scripts/install.sh | bash
# Setup HTTP endpoints for Windows access
./windows_config/setup_windows_access.sh start
This will:
In Windows - Configure Claude Desktop:
%APPDATA%\Claude\claude_desktop_config.jsonAvailable Windows MCP Servers:
Each MCP server provides complete Claude Desktop configuration in its documentation. Access the docs at:
Direct documentation URLs:
Sample Claude Desktop Configuration:
{
"mcpServers": {
"mcp-postgres-http": {
"command": "node",
"args": ["-e", "const http = require('http'); const data = JSON.stringify({name: process.argv[2], arguments: JSON.parse(process.argv[3] || '{}')}); const req = http.request('http://172.27.85.131:8080/mcp/tools/call', {method: 'POST', headers: {'Content-Type': 'application/json', 'Content-Length': data.length}}, res => {let body = ''; res.on('data', d => body += d); res.on('end', () => {try {const result = JSON.parse(body); console.log(JSON.stringify(result.result || result));} catch(e) {console.log(body);}});}); req.write(data); req.end();"],
"env": {},
"description": "PostgreSQL MCP Server via HTTP - Execute SQL queries and database operations"
},
"mcp-file-http": {
"command": "node",
"args": ["-e", "const http = require('http'); const data = JSON.stringify({name: process.argv[2], arguments: JSON.parse(process.argv[3] || '{}')}); const req = http.request('http://172.27.85.131:8081/mcp/tools/call', {method: 'POST', headers: {'Content-Type': 'application/json', 'Content-Length': data.length}}, res => {let body = ''; res.on('data', d => body += d); res.on('end', () => {try {const result = JSON.parse(body); console.log(JSON.stringify(result.result || result));} catch(e) {console.log(body);}});}); req.write(data); req.end();"],
"env": {},
"description": "File Operations MCP Server via HTTP - Read, write, and manage files"
},
"mcp-db-admin-http": {
"command": "node",
"args": ["-e", "const http = require('http'); const data = JSON.stringify({name: process.argv[2], arguments: JSON.parse(process.argv[3] || '{}')}); const req = http.request('http://172.27.85.131:8082/mcp/tools/call', {method: 'POST', headers: {'Content-Type': 'application/json', 'Content-Length': data.length}}, res => {let body = ''; res.on('data', d => body += d); res.on('end', () => {try {const result = JSON.parse(body); console.log(JSON.stringify(result.result || result));} catch(e) {console.log(body);}});}); req.write(data); req.end();"],
"env": {},
"description": "Database Administration MCP Server via HTTP - Create databases, manage users"
},
"mcp-orchestrator-http": {
"command": "node",
"args": ["-e", "const http = require('http'); const data = JSON.stringify({name: process.argv[2], arguments: JSON.parse(process.argv[3] || '{}')}); const req = http.request('http://172.27.85.131:8083/mcp/tools/call', {method: 'POST', headers: {'Content-Type': 'application/json', 'Content-Length': data.length}}, res => {let body = ''; res.on('data', d => body += d); res.on('end', () => {try {const result = JSON.parse(body); console.log(JSON.stringify(result.result || result));} catch(e) {console.log(body);}});}); req.write(data); req.end();"],
"env": {},
"description": "MCP Orchestrator via HTTP - Execute multi-server workflows and complex operations"
}
}
}
Important Notes:
172.27.85.131 with your actual WSL IP address (get it with hostname -I in WSL) setup_windows_access.shVerified Working Setup: ✅ 4 MCP Servers Available in Claude Desktop:
D:\MCP-Agents)✅ Database Targeting Fixed: Tables are now created in the correct database when specified (e.g., create tables in "TestDB" instead of defaulting to "postgres" database)
Troubleshooting:
%APPDATA%\Claude\logs\mcp-server-*.log for debuggingWindows Server Management:
# In WSL - manage HTTP servers
./windows_config/setup_windows_access.sh status # Check status
./windows_config/setup_windows_access.sh stop # Stop servers
./windows_config/setup_windows_access.sh restart # Restart servers
For native Windows installation (no WSL), see Windows Installation Guide.
Basic Example Server (calculator, random, system info):
cd julia_mcp_server
julia example.jl
File Server Example (file operations):
cd julia_mcp_server
julia file_server_example.jl
PostgreSQL Database Server (database operations):
cd julia_mcp_server
julia postgres_example.jl
Database Administration Server (database management):
cd julia_mcp_server
julia db_admin_example.jl
The file server automatically detects the operating system and uses appropriate defaults:
D:\MCP-Agents /mnt/d/MCP-Agents (if D: drive is mounted)~/MCP-AgentsYou can override the default with an environment variable:
MCP_FILE_SERVER_BASE=/custom/path julia file_server_example.jl
The PostgreSQL server can be configured with environment variables:
POSTGRES_HOST=localhost \
POSTGRES_PORT=5432 \
POSTGRES_USER=postgres \
POSTGRES_PASSWORD=mypassword \
POSTGRES_DB=mydatabase \
julia postgres_example.jl
Both PostgreSQL servers use the same configuration format. The database admin server includes all the features of the basic PostgreSQL server plus advanced administration tools.
The server will start and listen for JSON-RPC messages on stdin, responding on stdout.
You can test the server by sending JSON-RPC messages manually:
{"jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1}
{"jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 2}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "calculator", "arguments": {"operation": "add", "a": 5, "b": 3}}, "id": 3}
File Server Examples:
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_files", "arguments": {"path": "."}}, "id": 4}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "write_file", "arguments": {"path": "hello.txt", "content": "Hello World!"}}, "id": 5}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "read_file", "arguments": {"path": "hello.txt"}}, "id": 6}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "create_directory", "arguments": {"path": "my_folder"}}, "id": 7}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "delete_file", "arguments": {"path": "hello.txt"}}, "id": 8}
PostgreSQL Database Examples:
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_databases", "arguments": {}}, "id": 9}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_tables", "arguments": {"schema": "public"}}, "id": 10}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "execute_query", "arguments": {"query": "SELECT version()"}}, "id": 11}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "describe_table", "arguments": {"table": "users", "schema": "public"}}, "id": 12}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "execute_transaction", "arguments": {"queries": ["CREATE TABLE test (id INT)", "INSERT INTO test VALUES (1)", "DROP TABLE test"]}}, "id": 13}
PostgreSQL Database Targeting Examples:
# Execute SQL in specific database
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "execute_sql", "arguments": {"query": "CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(50))", "database": "TestDB"}}, "id": 14}
# List tables in specific database
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_tables", "arguments": {"database": "TestDB"}}, "id": 15}
# Describe table in specific database
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "describe_table", "arguments": {"table_name": "users", "database": "TestDB"}}, "id": 16}
Database Administration Examples:
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "create_database", "arguments": {"name": "my_new_db", "owner": "postgres"}}, "id": 14}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "create_user", "arguments": {"username": "app_user", "password": "secret123", "createdb": true}}, "id": 15}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "grant_privileges", "arguments": {"username": "app_user", "database": "my_new_db", "privileges": ["CONNECT", "CREATE"]}}, "id": 16}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "create_table_from_json", "arguments": {"table": "users", "schema": "{\"properties\":{\"id\":{\"type\":\"integer\"},\"name\":{\"type\":\"string\"}},\"primary_key\":[\"id\"]}"}}, "id": 17}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "import_data", "arguments": {"table": "users", "data": "[{\"id\":1,\"name\":\"Alice\"},{\"id\":2,\"name\":\"Bob\"}]", "format": "json"}}, "id": 18}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "export_data", "arguments": {"table": "users", "format": "csv", "limit": 100}}, "id": 19}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "export_schema", "arguments": {"database": "my_new_db", "format": "sql"}}, "id": 20}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "drop_database", "arguments": {"name": "my_new_db", "force": true}}, "id": 21}
To create a custom tool, define a function and add it to the server:
function my_custom_tool(args::Dict{String,Any})
# Your tool logic here
return "Tool result"
end
# Define the JSON schema for the tool's input
schema = Dict{String,Any}(
"type" => "object",
"properties" => Dict{String,Any}(
"param1" => Dict{String,Any}(
"type" => "string",
"description" => "Description of parameter"
)
),
"required" => ["param1"]
)
# Add to server
add_tool!(server, MCPTool(
"my_tool",
"Description of what the tool does",
schema,
my_custom_tool
))
This implementation supports the following MCP methods:
initialize - Initialize the server connectiontools/list - List available toolstools/call - Execute a specific tool"Connection refused" from Windows Claude
# In WSL - check server status
./windows_config/setup_windows_access.sh status
# Test connectivity from WSL
curl http://localhost:8080/mcp/health
# Check WSL IP address
hostname -I
"Server not responding"
# Check server logs
tail -f logs/*_http.log
# Restart servers
./windows_config/setup_windows_access.sh restart
# Verify Julia packages
julia --project=. -e "using Pkg; Pkg.status()"
"PowerShell execution errors"
Network connectivity test:
# From Windows PowerShell - test WSL server
Invoke-RestMethod -Uri http://YOUR_WSL_IP:8080/mcp/health
If Windows Claude cannot reach WSL servers:
WSL IP changes after reboot:
# Get current WSL IP
hostname -I | awk '{print $1}'
# Update Windows Claude config with new IP
./windows_config/setup_windows_access.sh start
Port conflicts:
# Check if ports are in use
netstat -tulpn | grep :8080
# Use different ports if needed
MCP_HTTP_PORT=9080 ./windows_config/setup_windows_access.sh start
Enable debug logging for troubleshooting:
export MCP_DEBUG_COMMUNICATION=true
export MCP_HTTP_DEBUG=true
./windows_config/setup_windows_access.sh start
Each MCP server provides comprehensive self-documenting capabilities:
Easy Access URLs (with auto-redirect):
Direct Documentation URLs:
Claude can query the documentation endpoints to:
Example: Claude querying server documentation:
Claude can visit http://172.27.85.131:8080/mcp/docs to see all PostgreSQL server capabilities,
tool schemas, and usage examples, enabling more efficient query planning.
This is a demonstration implementation of an MCP server in Julia.
Выполни в терминале:
claude mcp add mcpjuliaserver -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.