Overview
Introduction
Adding a new MCP server to Claude Desktop or another MCP host means hand-writing a small but easy-to-typo JSON block: a server name key, a command, an args array, and sometimes environment variables the server needs, like an API token.
This tool generates that mcpServers block from a form, so the JSON structure and quoting are always correct even when you're adding several servers.
What Is MCP Server Config Generator?
A generator for the mcpServers JSON object used by MCP clients to launch a stdio-based Model Context Protocol server: a server name, the command to run, its arguments, and any environment variables it needs.
The output matches the shape expected by Claude Desktop's and Claude Code's MCP configuration files, so it can be pasted directly into the mcpServers object of an existing config.
How MCP Server Config Generator Works
You name the server, provide the launch command (e.g. npx or python), add each command-line argument as its own row, and add any environment variables as key/value rows. The generator validates the server name and env var key formats.
It then produces a JSON object with a single mcpServers key containing your named server's command, args array, and (if any were added) an env object, ready to merge into a client's config file.
When To Use MCP Server Config Generator
Use it when adding a new local MCP server, whether one you wrote yourself or a published server package, to an MCP-compatible client.
It's also useful for documenting a server's exact launch command and required environment variables for teammates setting up the same tool.
Often used alongside LangChain Config Generator, OpenAI Environment Generator and Hugging Face Config Generator.
Features
Advantages
- Produces syntactically valid JSON with correctly quoted keys and values every time, avoiding hand-edited config typos.
- Validates environment variable naming so the generated config follows conventional uppercase-with-underscores style.
- Supports any number of arguments and environment variables via simple add/remove rows.
Limitations
- Only generates the stdio transport shape (command/args/env); HTTP/SSE-based remote MCP servers use a different config shape not covered here.
- Doesn't validate that the command or package actually exists or runs; it only builds the config structure.
Examples
Best Practices & Notes
Best Practices
- Keep secrets like API tokens in the env block rather than hardcoded inside an argument string, so they're easier to find and rotate.
- Give each server a descriptive, unique name, since the key doubles as the identifier shown in the client's server list.
- Merge the generated block into your existing config file's mcpServers object rather than replacing the whole file.
Developer Notes
The output matches the config shape documented for Claude Desktop and Claude Code's MCP integration: a top-level `mcpServers` object keyed by server name, each entry a `{command, args, env}` record the host spawns as a child process communicating over stdio, per the Model Context Protocol's stdio transport specification.
MCP Server Config Generator Use Cases
- Adding a new local MCP server (filesystem, database, API wrapper) to an MCP client
- Documenting a reproducible launch command and required env vars for a team-shared MCP server
- Quickly generating correctly formatted JSON when adding several servers at once
Common Mistakes
- Putting a secret token directly in the args array as a plain string instead of passing it via an environment variable.
- Forgetting that each shell argument needs to be its own array entry, and instead putting a whole command line as a single string.
Tips
- If the server needs no special environment variables, leave the env list empty, the generator omits the env key entirely rather than emitting an empty object.