Nuke MCP server

Provides a bridge to Nuke compositing software for automating common tasks like node creation, configuration, and render operations through a Python interface
Back to servers
Provider
Nikhil Aourpally
Release date
Mar 25, 2025
Language
Python
Stats
2 stars

This MCP (Model Context Protocol) server implementation provides a standardized way to interact with AI models. It serves as a compatible server for MCP-enabled clients, allowing you to deploy and interact with various AI models through a unified API.

Installation

You can install the MCP server using pip:

pip install nuke-mcp

For development or to get the latest version, you can install directly from the GitHub repository:

pip install git+https://github.com/TheNukeGame/nuke-mcp-2.git

Usage

Running the Server

To start the MCP server with default settings:

python -m mcp.server

The server will start on port 8000 by default. You can specify a different port using the --port argument:

python -m mcp.server --port 8080

Configuration

You can configure the server through a YAML configuration file. Create a file named config.yaml with the following structure:

models:
  - id: my-model
    path: /path/to/your/model
    type: llama
    options:
      max_tokens: 2048
      temperature: 0.7
      
  - id: another-model
    path: /path/to/another/model
    type: gpt
    options:
      max_tokens: 4096

Then start the server with the configuration:

python -m mcp.server --config config.yaml

API Endpoints

The MCP server provides the following key endpoints:

  • GET /v1/models: Lists all available models
  • POST /v1/chat/completions: Generates completions for chat messages
  • POST /v1/completions: Generates text completions

Example API Request

Here's an example of making a chat completion request:

curl -X POST http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "my-model",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello, how are you?"}
    ],
    "temperature": 0.7,
    "max_tokens": 100
  }'

Client Libraries

You can interact with the MCP server using any OpenAI-compatible client library by setting the base URL to your MCP server address:

import openai

client = openai.OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="dummy-key"  # MCP doesn't require authentication by default
)

response = client.chat.completions.create(
    model="my-model",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Write a haiku about programming."}
    ]
)

print(response.choices[0].message.content)

Troubleshooting

Common Issues

  • Model not loading: Ensure the model path in your configuration is correct and accessible
  • Port already in use: Change the port using the --port argument
  • Memory issues: Large models require sufficient RAM; consider using a quantized model version

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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