npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cadcamfun-mcp-server

v1.2.0

Published

MCP server for CAD/CAM applications with AI integration

Readme

CADCAMfun MCP Server

A Model Context Protocol (MCP) server for CAD/CAM applications that provides AI-powered design assistance, toolpath optimization, and machining parameter recommendations.

Overview

This MCP server exposes resources, tools, and prompts for CAD/CAM operations, allowing LLM applications to:

  • Generate CAD components from text descriptions
  • Optimize G-code for CNC machines
  • Analyze CAD designs for manufacturability, structural integrity, and cost
  • Get optimal cutting parameters for specific materials and tools
  • Save components and toolpaths to the database
  • Access CAD/CAM libraries, materials, and tools

Features

  • Resources: Access component data, toolpaths, projects, materials, and machine configurations
  • Tools: Generate CAD components, optimize G-code, analyze designs, calculate cutting parameters
  • Prompts: Generate component designs, get machining parameters, and suggest design improvements
  • Chat: Interactive assistance for CAD/CAM questions

Requirements

  • Node.js 18+
  • PostgreSQL database
  • TypeScript 5.0+
  • Prisma ORM

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/cadcamfun-mcp-server.git
    cd cadcamfun-mcp-server
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    cp .env.example .env
    # Edit the .env file with your database credentials and settings
  4. Apply database migrations:

    npx prisma migrate dev
  5. Build the project:

    npm run build

Running the Server

HTTP Server (Default)

To run as an HTTP server (recommended for web applications):

npm run start:http

The server will start at http://localhost:3000/mcp by default.

Stdio Server

To run as a stdio server (useful for command-line tools):

npm run start:stdio

Docker Deployment

Prerequisites

  • Docker and Docker Compose
  • API key for Anthropic Claude

Steps

  1. Set up the environment variables:

    Create a .env file in the root directory with your API key:

    ANTHROPIC_API_KEY=your-api-key-here
  2. Start the containers:

    cd docker
    docker-compose up -d
  3. Initialize the database:

    docker-compose exec mcp-server npm run setup-db
  4. Access the server at http://localhost:3000/mcp

API Reference

Resources

| URI | Description | |-----|-------------| | version://app | Application version information | | component://{id} | Get component by ID | | toolpath://{id} | Get toolpath by ID | | project://{id} | Get project by ID | | cam://materials | List available materials | | cam://tools | List available cutting tools | | cam://machine-configs | List available machine configurations | | cad://library-items | List public library items |

Tools

| Name | Description | |------|-------------| | generate-cad-component | Generate CAD components from text description | | optimize-gcode | Optimize G-code for CNC machines | | analyze-design | Analyze a CAD design for various aspects | | get-cutting-parameters | Get optimal cutting parameters | | save-component | Save a component to the database | | save-toolpath | Save a toolpath to the database |

Prompts

| Name | Description | |------|-------------| | generate-cad-component | Generate CAD components from description | | suggest-cad-improvements | Get suggestions for improving a CAD model | | machining-parameters-advice | Get advice on machining parameters |

Client Usage Example

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

// Create client
const client = new Client({
  name: "My CADCAMfun Client",
  version: "1.0.0"
});

// Connect to server
const serverUrl = new URL("http://localhost:3000/mcp");
const transport = new StreamableHTTPClientTransport(serverUrl);
await client.connect(transport);

// Generate a CAD component
const result = await client.callTool({
  name: "generate-cad-component",
  arguments: {
    description: "A simple 10mm x 10mm x 2mm base plate with 4 mounting holes",
    complexity: "simple",
    style: "precise"
  }
});

console.log("Generated Component:", result.content[0].text);

Using with Claude and Cursor

To use the CADCAMfun MCP server with Claude and Cursor, you'll need to:

  1. Start the MCP server
  2. Configure Cursor to use the MCP server as a language model provider
  3. Use Claude via the MCP server to assist with CAD/CAM tasks

This setup allows you to leverage Claude's capabilities through the MCP protocol, enhancing your CAD/CAM workflow with AI assistance.

Project Structure

cadcamfun-mcp-server/
├── .env                         # Environment variables
├── .env.example                 # Example environment file
├── .gitignore                   # Git ignore file
├── package.json                 # Node.js package configuration
├── tsconfig.json                # TypeScript configuration
├── prisma/                      # Prisma ORM files
│   └── schema.prisma            # Database schema
├── src/                         # Source code
│   ├── index.ts                 # Main entry point
│   ├── mcp-server.ts            # MCP server implementation
│   ├── types/                   # TypeScript type definitions
│   │   └── index.ts             # Types used in the server
│   ├── services/                # Service implementations
│   │   ├── aiService.ts         # AI service implementation
│   │   ├── cadService.ts        # CAD service implementation
│   │   └── camService.ts        # CAM service implementation
├── dist/                        # Compiled JavaScript files
├── scripts/                     # Utility scripts
│   └── setup-db.ts              # Database setup script
└── docker/                      # Docker deployment files
    ├── Dockerfile               # Docker image definition
    └── docker-compose.yml       # Docker Compose configuration

Available Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | DATABASE_URL | PostgreSQL connection string | postgresql://username:password@localhost:5432/cadcamfun | | DIRECT_DATABASE_URL | Direct PostgreSQL connection | Same as DATABASE_URL | | TRANSPORT | Transport type (http or stdio) | http | | PORT | HTTP server port | 3000 | | ANTHROPIC_API_KEY | API key for Anthropic Claude | | | AI_MODEL | Default AI model | claude-3-7-sonnet-20250219 | | AI_MAX_TOKENS | Maximum tokens for AI responses | 6000 | | AI_TEMPERATURE | Temperature for AI generation | 0.7 | | AI_CACHE_ENABLED | Enable AI response caching | true | | AI_ANALYTICS_ENABLED | Enable AI analytics | true | | MCP_ENABLED | Enable MCP protocol | true | | MCP_STRATEGY | MCP caching strategy | balanced | | MCP_CACHE_LIFETIME | Cache lifetime in milliseconds | 3600000 | | CORS_ORIGINS | Allowed CORS origins | http://localhost:3000,https://cadcam.example.com | | JWT_SECRET | Secret for JWT tokens | |

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT