Anthropic Prompt Engineering MCP server

Provides specialized prompt engineering capabilities for creating, improving, and templatizing prompts based on task descriptions and feedback.
Back to servers
Setup instructions
Provider
mystique920
Release date
Apr 09, 2025
Language
TypeScript
Stats
1 star

The MCP Anthropic Server provides tools for interacting with Anthropic's experimental prompt engineering APIs, allowing you to generate, improve, and templatize prompts. This server follows the Model Context Protocol (MCP) for standardized communication.

Installation

Prerequisites

  • Node.js and npm installed
  • An Anthropic API key

Setup Steps

  1. Navigate to the project directory:

    cd mcp-anthropic
    
  2. Install dependencies:

    npm install
    
  3. Configure API Key: Create a .env file in the project root and add your Anthropic API key:

    ANTHROPIC_KEY=your_anthropic_api_key_here
    

Running the Server

  1. Build the TypeScript code:

    npm run build
    
  2. Start the server:

    npm start
    

    The server will start and listen for MCP connections, displaying which tools are registered.

Available Tools

Generate Prompt

The generate_prompt tool creates a prompt based on a task description.

Example Usage:

{
  "task": "a chef for a meal prep planning service",
  "target_model": "claude-3-opus-20240229"
}

Improve Prompt

The improve_prompt tool enhances an existing prompt based on provided feedback.

Example Usage:

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Help me plan meals for the week."
        }
      ]
    }
  ],
  "feedback": "Make it more detailed and include nutrition considerations",
  "target_model": "claude-3-opus-20240229"
}

Templatize Prompt

The templatize_prompt tool converts a concrete prompt example into a reusable template.

Example Usage:

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Create a meal plan for a family of 4 with dietary restrictions including gluten-free and dairy-free options."
        }
      ]
    }
  ]
}

Tool Input Schemas

Generate Prompt Input

{
  "type": "object",
  "properties": {
    "task": {
      "type": "string",
      "description": "A description of the task the prompt should be designed for."
    },
    "target_model": {
      "type": "string",
      "description": "The target Anthropic model identifier."
    }
  },
  "required": ["task", "target_model"]
}

Improve Prompt Input

{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": { "type": "string" },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": { "type": "string" },
                "text": { "type": "string" }
              },
              "required": ["type", "text"]
            }
          }
        },
        "required": ["role", "content"]
      }
    },
    "system": {
      "type": "string"
    },
    "feedback": {
      "type": "string"
    },
    "target_model": {
      "type": "string"
    }
  },
  "required": ["messages", "feedback", "target_model"]
}

Templatize Prompt Input

{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": { "type": "string" },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": { "type": "string" },
                "text": { "type": "string" }
              },
              "required": ["type", "text"]
            }
          }
        },
        "required": ["role", "content"]
      }
    },
    "system": {
      "type": "string"
    }
  },
  "required": ["messages"]
}

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-anthropic" '{"command":"npm","args":["start"],"cwd":"./mcp-anthropic"}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-anthropic": {
            "command": "npm",
            "args": [
                "start"
            ],
            "cwd": "./mcp-anthropic"
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-anthropic": {
            "command": "npm",
            "args": [
                "start"
            ],
            "cwd": "./mcp-anthropic"
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later