Building Custom MCPs

Build powerful custom integrations with MCP Studio's visual builder. Write Python or Node.js code with AI assistance, validate your integration, and deploy to productionβ€”all from your browser.

circle-check

Overview

The MCP Builder provides a complete development environment for creating custom integrations. Whether you're connecting to a proprietary API, building a custom database connector, or creating specialized tools, the builder has everything you need.

Feature
Description

AI Code Generation

Describe your goal in natural language

Visual Code Editor

Full-featured editor with syntax highlighting

Real-Time Validation

Catch errors before deployment

Integrated Testing

Test your tools without deploying

Secrets Management

Secure credential storage

Auto-Save

Never lose your work

The 5-Tab Workflow

MCP Studio guides you through building an integration with five tabs:

spinner
Tab
Purpose
Key Actions

Start

Begin your integration

AI generation, templates, or blank canvas

Build

Write and test code

Edit code, configure secrets, validate, test

Deploy

Deploy to production

Validate and deploy with streaming progress

Connect

Enable the integration

Toggle for Darcy, get connection details

Monitor

Debug and troubleshoot

View real-time logs

Creating a New MCP Server

1

Navigate to MCP Studio

From the DarcyIQ sidebar, click MCP Studio, then select the My MCPs tab.

2

Click Create MCP

Click the Create MCP button in the top right corner.

3

Name Your Integration

Enter a descriptive name for your integration (e.g., "Customer Database Connector" or "Slack Notifier").

4

Choose Your Starting Point

You'll be taken to the Start tab where you can choose how to begin.

Start Tab: Choose Your Approach

The Start tab offers three ways to begin building:

Let DarcyIQ write the code for you:

  1. Describe Your Goal: In the text area, describe what you want your integration to do

  2. Click Generate: DarcyIQ analyzes your request and generates complete code

  3. Review and Edit: The generated code appears in the Build tab for review

Example Prompts:

Goal
Prompt Example

Database Query

"Create an integration that connects to PostgreSQL and allows querying customer data by email or ID"

API Integration

"Build an integration for the Stripe API that can retrieve payment history and customer details"

Notification Service

"Create a Slack integration that can send messages to any channel with formatting support"

File Processing

"Build an integration that reads CSV files and returns the data as structured JSON"

Option 2: Start from a Template

Choose from pre-built templates:

Template
Description
Best For

Basic Python

Minimal Python MCP server

Simple integrations

Python with Auth

Python template with authentication

Secure API connections

Basic Node.js

Minimal Node.js MCP server

JavaScript developers

REST API Wrapper

Template for wrapping REST APIs

API integrations

Option 3: Blank Canvas

Start with an empty editor and write everything from scratch. Recommended only for experienced MCP developers or importing existing MCPs into MCP Studio.

Build Tab: Code Editor

The Build tab is where you write, edit, and test your integration code.

Code Editor Features

Feature
Description

Syntax Highlighting

Full color coding for Python and JavaScript

Error Detection

Real-time validation as you type

Auto-Detection

Runtime automatically detected from code

Line Numbers

Easy navigation and debugging

Auto-Save

Changes saved automatically every 3 seconds

Writing MCP Server Code

Your MCP server code defines the tools that will be available to DarcyIQ. Here's the basic structure:

Python Example:

Node.js Example:

Tool Documentation

circle-info

Best Practice: Write clear docstrings for your tools. The AI uses these descriptions to understand when and how to use each tool.

Good documentation includes:

Element
Purpose
Example

Brief Description

One-line summary of what the tool does

"Retrieve customer information by ID"

Args Section

Document each parameter

"customer_id: The unique identifier for the customer"

Returns Section

Describe the output

"Customer details including name, email, and account status"

Validation

Click the Validate button to check your code for errors:

Validation Type
What It Checks

Syntax Errors

Code compiles without errors

Import Validation

All imports are available

Tool Detection

At least one tool is defined

Secret Detection

Environment variables are identified

Validation results appear inline with your code:

Status
Meaning

βœ… Valid

Code passes all checks

⚠️ Warning

Non-critical issues to review

❌ Error

Must be fixed before deployment

Secrets Management

The Secrets section lets you configure environment variables securely:

1

Auto-Detection

MCP Studio automatically detects environment variables used in your code (e.g., os.environ.get("API_KEY")).

2

Configure Secrets

For each detected secret, provide:

  • Name: The environment variable name (auto-filled)

  • Display Name: A friendly label for the UI

  • Description: What this credential is for

  • Required: Whether deployment requires this value

3

Enter Values

Enter the actual secret values. These are stored securely and never exposed in code or logs.

Testing Your Tools

The Test Panel lets you test tools before deployment:

1

Open Test Panel

Click Test in the Build tab toolbar to open the test panel.

2

Select a Tool

Choose which tool to test from the dropdown.

3

Enter Parameters

Fill in the required parameters for the tool.

4

Run Test

Click Run to execute the tool. Results appear in the panel.

Runtime Support

MCP Studio supports two runtimes:

Python

Aspect
Details

Version

Python 3.11+

Package Manager

pip with requirements.txt

MCP SDK

mcp package

Common Libraries

requests, httpx, asyncio, pandas

Specifying Dependencies:

Add a comment block at the top of your file:

Node.js

Aspect
Details

Version

Node.js 18+

Package Manager

npm with package.json

MCP SDK

@modelcontextprotocol/sdk

Common Libraries

axios, node-fetch, lodash

Specifying Dependencies:

Dependencies are auto-detected from import statements, or you can include a package.json comment:

Best Practices for Custom MCPs

Code Organization

Practice
Description

Single Responsibility

Each tool should do one thing well

Clear Naming

Use descriptive tool and parameter names

Error Handling

Always handle potential errors gracefully

Logging

Add logging for debugging (visible in Monitor tab)

Error Handling

Security Considerations

Practice
Description

Use Environment Variables

Never hardcode credentials

Validate Input

Check parameters before using them

Limit Scope

Only request permissions you need

Sanitize Output

Don't expose sensitive data in responses

Common Patterns

REST API Wrapper

Database Query

Next Steps

Once your code is ready, proceed to deployment:

Goal
Documentation

Deploy your integration

View more code examples

Troubleshoot issues

Last updated

Was this helpful?