mcpField
S
Simple Osc Mcp Server

Simple Osc Mcp Server

Local
github.com/noodledostuffMedia & Design2Updated 62w ago

About Simple Osc Mcp Server

Simple Osc Mcp Server connects AI agents with OSC-enabled applications by creating UDP listeners and providing access to received messages. It supports address filtering, message buffering, and endpoint monitoring.

Key features

  1. 01Create and manage multiple UDP endpoints
  2. 02Buffer and query received OSC messages
  3. 03Filter by OSC address patterns
  4. 04Monitor endpoint and message status

Use cases

  1. 01Collect OSC messages from SuperCollider or Max/MSP
  2. 02Filter synthesizer data by address pattern
  3. 03Check endpoint status and retrieve recent messages

MCP support

The MCP server exposes tools for creating, stopping, and inspecting OSC endpoints, as well as querying received messages and endpoint status.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"osc": {
"command": "npx",
"args": [
"-y",
"osc-mcp-server"
]
}
}
}
Run commandnpx -y osc-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmosc-mcp-server

Tools

4

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
portnumberYesUDP port number to listen on (1024-65535)
bufferSizenumberNoMaximum number of messages to store in buffer (default: 1000)
addressFiltersarrayNoOSC address patterns to filter messages (optional)

Details

From the project README

Simple OSC MCP Server

CI/CD Pipeline Security Scan npm version

A Model Context Protocol (MCP) server that enables AI agents to create OSC (Open Sound Control) endpoints and receive OSC messages. This server provides a bridge between AI agents and OSC-enabled applications like SuperCollider, Max/MSP, TouchOSC, and other music/audio software.

Features

  • OSC Endpoint Management: Create and manage multiple UDP endpoints for receiving OSC messages
  • Message Buffering: Store and query received OSC messages with configurable buffer sizes
  • Pattern Filtering: Filter messages by OSC address patterns for targeted data collection
  • VSCode Integration: Full compatibility with VSCode's MCP client for seamless development workflow
  • Real-time Monitoring: Track endpoint status and message flow in real-time
  • Type Safety: Built with TypeScript for robust type checking and better developer experience

Installation

Quick Start with npx (Recommended)
npx osc-mcp-server
Global Installation
npm install -g osc-mcp-server
osc-mcp-server
Local Installation
npm install osc-mcp-server
npx osc-mcp-server

Requirements

  • Node.js: 18.0.0 or higher
  • Operating System: Windows, macOS, or Linux
  • Network: UDP port access for OSC communication (ports 1024-65535)

Usage

VSCode Integration

The OSC MCP Server is designed to work seamlessly with VSCode's MCP client. To configure it:

  1. Install the MCP extension in VSCode (if not already installed)

  2. Add server configuration to your VSCode settings or workspace .vscode/settings.json:

{
  "mcp.servers": {
    "osc-server": {
      "command": "npx",
      "args": ["osc-mcp-server"],
      "env": {}
    }
  }
}
  1. Restart VSCode to load the server

  2. Verify connection by checking the MCP panel in VSCode - you should see "osc-server" listed as active

Available Tools

The server provides four main tools for OSC interaction:

1. create_osc_endpoint

Creates a new OSC endpoint to listen for incoming messages.

Parameters:

  • port (required): UDP port number (1024-65535)
  • bufferSize (optional): Maximum messages to store (default: 1000, max: 10000)
  • addressFilters (optional): Array of OSC address patterns to filter messages

Example:

{
  "port": 8000,
  "bufferSize": 500,
  "addressFilters": ["/synth/*", "/effects/reverb"]
}
2. stop_osc_endpoint

Stops and removes an existing OSC endpoint.

Parameters:

  • endpointId (required): ID of the endpoint to stop

Example:

{
  "endpointId": "endpoint_8000_1234567890"
}
3. get_osc_messages

Queries received OSC messages from endpoints.

Parameters:

  • endpointId (optional): Specific endpoint ID (if omitted, queries all endpoints)
  • addressPattern (optional): OSC address pattern to filter messages
  • timeWindowSeconds (optional): Time window in seconds (from now backwards)
  • limit (optional): Maximum number of messages to return (max: 1000)

Example:

{
  "endpointId": "endpoint_8000_1234567890",
  "addressPattern": "/synth/freq",
  "timeWindowSeconds": 30,
  "limit": 50
}
4. get_endpoint_status

Gets status information for OSC endpoints.

Parameters:

  • endpointId (optional): Specific endpoint ID (if omitted, returns all endpoints)

Example:

{
  "endpointId": "endpoint_8000_1234567890"
}
Command Line Usage

When running the server directly, it starts in stdio mode for MCP communication:

# Start the server
npx osc-mcp-server

# The server will output startup information to stderr
# and handle MCP communication via stdin/stdout
Example Workflow

Here's a typical workflow for using the OSC MCP Server:

  1. Create an endpoint to listen for OSC messages:

    {
      "tool": "create_osc_endpoint",
      "parameters": {
        "port": 8000,
        "bufferSize": 1000,
        "addressFilters": ["/synth/*"]
      }
    }
    
  2. Send OSC messages from your application (SuperCollider, Max/MSP, etc.) to localhost:8000

  3. Query received messages:

    {
      "tool": "get_osc_messages",
      "parameters": {
        "timeWindowSeconds": 60,
        "limit": 100
      }
    }
    
  4. Check endpoint status:

    {
      "tool": "get_endpoint_status",
      "parameters": {}
    }
    
  5. Stop the endpoint when done:

    {
      "tool": "stop_osc_endpoint",
      "parameters": {
        "endpointId": "endpoint_8000_1234567890"
      }
    }
    

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Lint code
npm run lint

# Format code
npm run format

Troubleshooting

Common Issues
Server Connection Issues

Problem: VSCode shows "osc-server" as disconnected or not listed

  • Solution: Check that Node.js 18+ is installed and accessible
  • Solution: Verify the MCP configuration in VSCode settings
  • Solution: Restart VSCode after configuration changes
  • Solution: Check VSCode's output panel for MCP-related error messages

Problem: "Command not found" error when using npx

  • Solution: Ensure npm is installed and up to date: npm install -g npm@latest
  • Solution: Clear npm cache: npm cache clean --force
  • Solution: Try installing globally first: npm install -g osc-mcp-server
OSC Endpoint Issues

Problem: "Port already in use" error

  • Solution: Choose a different port number (1024-65535)
  • Solution: Check what's using the port: netstat -an | grep :8000 (replace 8000 with your port)
  • Solution: Stop other applications using the same port

Problem: "Permission denied" error on low port numbers

  • Solution: Use ports 1024 and above (ports below 1024 require admin privileges)
  • Solution: On Linux/macOS, run with sudo only if absolutely necessary

Problem: No OSC messages received

  • Solution: Verify the sending application is configured to send to the correct IP and port
  • Solution: Check firewall settings - ensure UDP traffic is allowed on the specified port
  • Solution: Test with a simple OSC sender like TouchOSC or SuperCollider
  • Solution: Verify address filters aren't too restrictive
Message Query Issues

Problem: Empty message results when messages should exist

  • Solution: Check the time window - messages might be older than the specified timeWindowSeconds
  • Solution: Verify address pattern matching - OSC patterns are case-sensitive
  • Solution: Check if endpoint buffer size was exceeded (older messages get removed)

Problem: "Endpoint not found" error

  • Solution: Use get_endpoint_status to list available endpoint IDs
  • Solution: Verify the endpoint wasn't stopped or crashed
  • Solution: Check for typos in the endpoint ID
Performance Considerations
High-Frequency Messages

If you're receiving many OSC messages per second:

  • Increase buffer size to prevent message loss: "bufferSize": 5000
  • Use address filters to reduce processing overhead
  • Query messages more frequently to prevent buffer overflow
  • Consider multiple endpoints for different message types
Memory Usage
  • Monitor buffer sizes - larger buffers use more memory
  • Set appropriate limits on message queries to avoid large responses
  • Stop unused endpoints to free resources
Network Configuration
Firewall Settings

Windows:

# Allow UDP traffic on port 8000 (replace with your port)
netsh advfirewall firewall add rule name="OSC MCP Server" dir=in action=allow protocol=UDP localport=8000

macOS:

# Check if firewall is blocking the port
sudo pfctl -sr | grep 8000

Linux (Ubuntu/Debian):

# Allow UDP traffic on port 8000
sudo ufw allow 8000/udp
Testing OSC Communication

Use these tools to test OSC message sending:

SuperCollider:

// Send a test message
n = NetAddr("127.0.0.1", 8000);
n.sendMsg("/test", 440, "hello");

Max/MSP:

[udpsend 127.0.0.1 8000]
|
[/test 440 hello(

Python (python-osc):

from pythonosc import udp_client

client = udp_client.SimpleUDPClient("127.0.0.1", 8000)
client.send_message("/test", [440, "hello"])
Debug Mode

For detailed logging, you can check the stderr output when running the server:

npx osc-mcp-server 2> debug.log

This will capture all debug messages to a file for analysis.

Getting Help

If you encounter issues not covered here:

  1. Check the GitHub Issues: https://github.com/username/osc-mcp-server/issues
  2. Create a new issue with:
    • Your operating system and Node.js version
    • Complete error messages
    • Steps to reproduce the problem
    • Your MCP configuration

Documentation

API Reference
Examples and Workflows
Specific Workflows
Development

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

  • Automated Testing: Runs on Node.js 18, 20, and 22
  • Code Quality: ESLint, Prettier, and TypeScript checks
  • Security Scanning: npm audit and vulnerability scanning
  • Coverage Reporting: 80% coverage threshold required
  • Automated Publishing: Publishes to npm on tagged releases
Release Process

Create a new release by pushing a git tag:

git tag v1.0.0
git push origin v1.0.0

Or use the PowerShell release script:

.\scripts\release.ps1 patch  # or minor, major, prerelease

For detailed CI/CD documentation, see docs/CI-CD.md.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.