Skip to content

Demo Hello MCP Server Usage Guide

Overview

This guide shows how to use the Demo Hello MCP Server with different MCP clients and integration methods.

Tool Discovery

# Start interactive mode
mcp_platform interactive

# List available tools
mcpp> tools demo
# Discover tools using CLI
mcp_platform tools demo
from mcp_platform.client import MCPClient

async def discover_tools():
    client = MCPClient()
    tools = client.list_tools("demo")
    for tool in tools:
        print(f"Tool: {tool['name']} - {tool['description']}")

Available Tools

say_hello

Description: Generate a personalized greeting message.

PATTERN 1: Uses standard config from config_schema - hello_from: Set via --config hello_from="value" or MCP_HELLO_FROM env var

PATTERN 2: Uses template data that can be overridden - Tool behavior can be modified via --tools__0__greeting_style="formal"

Args: name: Name of the person to greet

Returns: A personalized greeting message

Parameters: - name (string) (optional): No description

get_server_info

Description: Get information about the demo server.

Shows both standard config and template data that may be overridden.

Returns: Dictionary containing server information

Parameters: - No parameters required

echo_message

Description: Echo back a message with server identification.

Demonstrates template data override for tool behavior.

Args: message: Message to echo back

Returns: Echoed message with server identification

Parameters: - message (string) (required): No description

demonstrate_overrides

Description: Demonstrate the two configuration patterns.

Returns: Examples of both configuration patterns

Parameters: - No parameters required

Usage Examples

# Start interactive mode
mcp_platform interactive

# Deploy the template (if not already deployed)
mcpp> deploy demo

# List available tools after deployment
mcpp> tools demo

Then call tools:

mcpp> call demo say_hello '{"name": "example_value"}'
mcpp> call demo get_server_info
mcpp> call demo echo_message '{"message": "example_value"}'
# Deploy the template
mcp_platform deploy demo

# Check deployment status
mcp_platform status

# View logs
mcp_platform logs demo

# Stop the template
mcp_platform stop demo
import asyncio
from mcp_platform.client import MCPClient

async def use_demo():
    client = MCPClient()

    # Start the server
    deployment = client.start_server("demo", {})

    if deployment["success"]:
        deployment_id = deployment["deployment_id"]

        try:
            # Discover available tools
            tools = client.list_tools("demo")
            print(f"Available tools: {[t['name'] for t in tools]}")

            # Call say_hello
            result = client.call_tool("demo", "say_hello", {'name': 'example_value'})
            print(f"say_hello result: {result}")

            # Call get_server_info
            result = client.call_tool("demo", "get_server_info", {})
            print(f"get_server_info result: {result}")

        finally:
            # Clean up
            client.stop_server(deployment_id)
    else:
        print("Failed to start server")

# Run the example
asyncio.run(use_demo())

Integration Examples

Add this configuration to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "demo": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "demo", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}

Install the MCP extension and add this to your VS Code settings (.vscode/settings.json):

{
  "mcp.servers": {
    "demo": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "demo", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}
# Get connection details for other integrations
mcp_platform connect demo --llm claude
mcp_platform connect demo --llm vscode

Configuration

For template-specific configuration options, see the main template documentation. Common configuration methods:

# Deploy with environment variables
mcp_platform deploy demo --env KEY=VALUE
# Deploy with configuration
mcp_platform deploy demo --config key=value

# Deploy with nested configuration
mcp_platform deploy demo --config category__property=value
# Deploy with config file
mcp_platform deploy demo --config-file config.json

Troubleshooting

Common Issues

  1. Template not found: Ensure the template name is correct

    mcp_platform list  # List available templates
    

  2. Connection issues: Check if the server is running

    mcp_platform status
    

  3. Tool discovery fails: Try refreshing the tool cache

    mcpp> tools demo --refresh
    

Debug Mode

Enable debug logging for troubleshooting:

# Interactive CLI with debug
LOG_LEVEL=debug mcp_platform interactive
# Deploy with debug logging
mcp_platform deploy demo --config log_level=debug

For more help, see the main documentation or open an issue in the repository.