Skip to main content
Glama
mlobo2012

Claude Desktop API MCP

by mlobo2012

send-message

Send messages to Claude through the Claude Desktop API MCP server to bypass Professional Plan limitations and access advanced features like custom system prompts.

Instructions

Send a message to Claude

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to Claude

Implementation Reference

  • Handler for the 'send-message' tool: checks the tool name, calls the Anthropic Claude API with the message from arguments, extracts the text response, and returns it as content.
    if (request.params.name === "send-message" && request.params.arguments?.message) {
      try {
        const msg = await client.messages.create({
          model: "claude-3-opus-20240229",
          max_tokens: 1024,
          messages: [
            { 
              role: "user", 
              content: String(request.params.arguments.message)
            }
          ]
        });
    
        const responseText = msg.content[0].type === 'text' ? msg.content[0].text : 'No text response available';
    
        return {
          content: [
            {
              type: "text",
              text: responseText
            }
          ]
        };
      } catch (error) {
        log(`Error calling Claude API: ${error}`);
        throw error;
      }
    }
  • src/index.ts:30-43 (registration)
    Registration of the 'send-message' tool in the ListTools response, specifying name, description, and input schema.
    {
      name: "send-message",
      description: "Send a message to Claude",
      inputSchema: {
        type: "object",
        properties: {
          message: {
            type: "string",
            description: "Message to send to Claude"
          }
        },
        required: ["message"]
      }
    }
  • Input schema definition for the 'send-message' tool, requiring a 'message' string.
    inputSchema: {
      type: "object",
      properties: {
        message: {
          type: "string",
          description: "Message to send to Claude"
        }
      },
      required: ["message"]
    }
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mlobo2012/Claude_Desktop_API_USE_VIA_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server