To set up an MCP server, you install an SDK, define a few tools as ordinary functions, and register the server with a client such as Claude Desktop. Python's FastMCP API is the quickest route. The choice that matters is the transport, not the language. A local stdio server runs on your own machine and needs no login. A remote HTTP server can be reached from anywhere, so it needs real authentication.
TL;DR:
- An MCP server is a small program that exposes tools, resources, and prompts to an AI client over JSON-RPC 2.0, and a working one takes about 15 lines of Python.
- Start local with the stdio transport. It runs on your machine, the client launches it, and it needs no authentication or open ports.
- On a Mac, most failed setups come from three causes: relative paths in claude_desktop_config.json, a
uvbinary the app can't find, and not fully quitting Claude after editing the config.- Never print to stdout from a stdio server. Your debug line will corrupt the protocol stream, so log to stderr instead.
- You can build your own server for WordPress, but the work is in authentication, error handling, and covering dozens of admin jobs, not in the protocol itself.
Table of Contents
- What You Are Actually Setting Up: A Host, a Client, and a Server
- Local or Remote? The Transport Decision That Shapes Everything Else
- How to Set Up an MCP Server on Your Computer in Python
- Set Up an MCP Server on a Mac Without the PATH Headache
- How to Connect to an MCP Server From Claude, ChatGPT, or Your Own Code
- Sampling in MCP: When the Server Borrows Your Model
- Can You Build Your Own Server? Yes. Should You, for WordPress? Usually Not
- Connect Claude or ChatGPT to Every WordPress Site You Run, for One Payment
- Frequently Asked Questions
- Sources
What You Are Actually Setting Up: A Host, a Client, and a Server
The Model Context Protocol has three moving parts, and most confusion comes from mixing them up. The host is the app you type into, such as Claude Desktop. Inside the host, an MCP client keeps one connection per server. The server is the program you write. It tells the client what it can do and does it when asked.
Anthropic introduced MCP as an open standard in November 2024. The aim was that one server could work with any compatible AI app, so you would not need a custom integration for each one. Under the hood, every message is a JSON-RPC 2.0 request or response. You will rarely touch that layer directly, because the SDKs handle it.
A server can offer three kinds of things:
- Tools. These are functions the model can call, such as "count the words in this text" or "publish this draft." Most servers you build will be mostly tools.
- Resources. This is read-only data the client can pull in as context, such as a file, a database row, or a site's settings.
- Prompts. These are reusable templates the user can pick from a menu, such as "write a product description in our house style."
If you have built against a REST API before, the mental model is close. MCP adds a standard way for the AI to discover what is available. It doesn't replace the API underneath. (Our plain-English guide to APIs covers that layer if it is fuzzy.)
Local or Remote? The Transport Decision That Shapes Everything Else

Yes, you can host an MCP server locally. For a first server, that is what we would tell you to do. The protocol defines two standard transports, and the one you pick decides how much security work you take on.
| stdio (local) | Streamable HTTP (remote) | |
|---|---|---|
| Where it runs | Your own computer | A server or cloud host |
| Who starts it | The client launches it as a subprocess | You run it; clients connect by URL |
| Authentication | None needed; credentials come from environment variables | OAuth 2.1 recommended by the spec |
| Reachable from | That one machine | Anywhere with network access |
| Works with phone or web clients | No | Yes |
| Setup time for a beginner | Under an hour | An afternoon to several days |
| Main risk | A badly written tool damaging your own files | Anyone on the internet calling your tools |
With stdio, the client starts your server and talks to it through standard input and output. No port is opened and nothing is exposed to the network. That makes it the safest place to learn. Streamable HTTP replaced the older HTTP-plus-Server-Sent-Events transport in the March 2025 revision of the spec. It is what you need when a web-based client or a teammate has to reach the server.
There is a middle case that catches people out. You might run an HTTP server on your own laptop for testing, and that is fine. Just bind it to localhost and not to every network interface. The MCP transport specification says that local servers should bind only to 127.0.0.1. It also says servers must validate the Origin header to block DNS rebinding attacks.
Bind to 127.0.0.1, never 0.0.0.0. A local MCP server listening on every interface is a set of tools anyone on your café Wi-Fi can call.
How to Set Up an MCP Server on Your Computer in Python
You can create a server on your own computer in four steps. You don't need a framework beyond the SDK. We would pick Python over TypeScript for a first server. The official MCP Python SDK includes the high-level FastMCP API, so a tool is just a function with a decorator. Official SDKs also exist for TypeScript, C#, Java, and several other languages if you would rather stay in your usual stack.
Step 1: Create the project
Install uv, a fast Python package manager, then run:
uv init word-counter
cd word-counter
uv add "mcp[cli]"
If you prefer pip, pip install "mcp[cli]" inside a virtual environment works too.
Step 2: Write the server
Create server.py:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("word-counter")
@mcp.tool()
def count_words(text: str) -> int:
"""Count the words in a block of text."""
return len(text.split())
if __name__ == "__main__":
mcp.run() # stdio by default
That is a complete MCP server. The type hints become the tool's input schema, and the docstring becomes the description the model reads. Write that docstring as if you were briefing a new hire, because the model uses it to decide when to call the tool.
Step 3: Test it before any AI touches it
Run uv run mcp dev server.py. This opens the MCP Inspector, a browser tool that connects to your server, lists its tools, and lets you call them by hand. If a tool fails in the Inspector, it will fail in Claude too, and the Inspector shows you why.
Step 4: Register it with a client
Add the server to your client's config file. On a Mac, that step has its own pitfalls, covered in the next section.
What about the standalone FastMCP project?
People searching for FastMCP find two things that share the name. The first version was folded into the official Python SDK, and that is the mcp.server.fastmcp import above. A separate, independently maintained FastMCP project continued after that, with extras for deployment, auth, and composing servers together. Start with the SDK version. Move to the standalone one only if you hit a feature you actually need.
Set Up an MCP Server on a Mac Without the PATH Headache
On macOS, Claude Desktop reads its servers from a single JSON file:
~/Library/Application Support/Claude/claude_desktop_config.json
You can open it from Claude's settings under Developer, then Edit Config. On Windows, the same file lives at %APPDATA%\Claude\claude_desktop_config.json. Add your server like this:
{
"mcpServers": {
"word-counter": {
"command": "/Users/you/.local/bin/uv",
"args": ["--directory", "/Users/you/word-counter", "run", "server.py"]
}
}
}
Three things break Mac setups more than anything else:
- Relative paths. Claude launches your server from a different working directory than your terminal does. Use absolute paths for both the command and the project folder.
- A
uvthe app can't find. Desktop apps don't inherit your shell's PATH. Runwhich uvin Terminal and paste the full result into"command". On Apple Silicon with Homebrew, it is often/opt/homebrew/bin/uv. - A half-restart. Closing the window doesn't reload the config. Quit Claude fully with Cmd+Q, then reopen it.
If the server still doesn't appear, check the logs at ~/Library/Logs/Claude/. Files named mcp*.log record each server's startup, including the error message you were missing.
Pro Tip: Never use print() in a stdio server. Standard output is the protocol channel, so one stray debug line in the middle of the JSON-RPC stream makes the client drop the connection. The symptom is unhelpful: the server "disconnects" with no obvious cause. Send diagnostics to stderr with print(..., file=sys.stderr) or Python's logging module. Claude captures stderr in the log files above.
One stray print() to stdout is enough to kill a stdio MCP server. Log to stderr, always.
How to Connect to an MCP Server From Claude, ChatGPT, or Your Own Code
How you connect depends on the transport the server speaks.
- Claude Desktop, local server. Use the config file shown above. Once Claude loads it, your tools appear in the chat's tools menu. Claude asks for permission before calling a tool, and you can approve once or always.
- Claude Code. The command-line agent can register servers with its own
claude mcp addcommand. Runclaude mcp --helpto see the current options for local and remote servers. - ChatGPT. OpenAI's MCP support is built around remote servers reached over HTTPS. A stdio-only server on your laptop won't show up there until you expose it over Streamable HTTP. This area has changed quickly, so check OpenAI's current documentation before you plan around it.
- Remote servers in any client. You give the client a URL, such as
https://tools.example.com/mcp, and complete an OAuth sign-in if the server requires one. - Your own code. The same SDKs that build servers also include client classes. They are useful for automated tests or for running an agent without a chat app.
For a first connection, use the MCP Inspector, not a chat app. It takes the model out of the picture, so if something fails, you know the problem is in your server and not in the model's choice of tool.
Sampling in MCP: When the Server Borrows Your Model
Sampling turns the usual direction around. Normally, the model calls the server. With sampling, the server asks the client's model to generate text. As the sampling section of the MCP specification describes it, the server sends a sampling/createMessage request. The client runs it through whatever model the user already has. The client keeps control the whole time, and the spec says a human should be able to review and reject these requests.
The practical benefit is that your server doesn't need its own AI API key or its own bill. Here is an example: a WordPress tool fetches a draft post, then uses sampling to ask the user's model to summarize it into a meta description, all with no API key stored on the server.
The catch is support. Clients don't all implement sampling, and some that do ask the user to approve each request. Treat it as an optional feature. If your tool only works when sampling is available, it will break for a share of your users.
Can You Build Your Own Server? Yes. Should You, for WordPress? Usually Not

You can build your own MCP server. The fifteen lines above prove it, and we would encourage anyone curious to do it once. It is the quickest way to understand what these tools are doing.
Building one to manage real WordPress sites is a different job, and the protocol is the easy part. The work goes into everything around it:
- Authentication. WordPress's REST API is the sensible way in, usually with application passwords. These require HTTPS by default and are often blocked by security plugins or hosts. Our guide to why WordPress application passwords fail lists the usual causes.
- Coverage. "Write a post" is one tool. Updating menus, swapping images, handling comments, and editing SEO fields across four different SEO plugins is dozens more, each with its own edge cases.
- Many sites. Credentials, rate limits, and errors multiply with every site you add. If you run a network, read when WordPress Multisite beats separate sites first, because it changes how you would wire this up.
- Failure handling. A model calling a tool that returns a vague 500 error will either give up or, worse, try something else. Clear error messages are most of the effort.
A rough rule: a toy server takes an afternoon. A server you would trust with a client's live site takes weeks, and then it needs maintenance every time WordPress or a plugin changes its API. If your time is billable, that math rarely works. The case where building wins is a single, narrow, in-house workflow that no ready-made tool covers.
Connect Claude or ChatGPT to Every WordPress Site You Run, for One Payment

If the section above sounded like weeks you don't have, PressHand is the ready-built version. It runs on your own machine or server and connects Claude or ChatGPT to every WordPress site you manage. It covers 83 jobs, including posts, pages, images, menus, plugins, CSS, and comments. It scores live pages for SEO out of 100 and works with Yoast, Rank Math, All in One SEO, and SEOPress.
It costs $97 once for every site you own, with no per-site fees. The Agency license costs $197 and adds the right to rebrand and resell it. After 12 months, yearly updates are optional at $49. Here is the honest caveat: PressHand connects through the WordPress REST API, so a site where the host or a security plugin blocks the REST API or application passwords needs that fixed first. You also need your own Claude or ChatGPT plan.
Frequently Asked Questions
Do I need to know how to code to set up an MCP server?
To build one, you need basic Python or TypeScript, though a simple server is only about 15 lines. To use an existing server, you only need to edit a JSON config file and restart your AI client. Many people never write a server and just install ones that others have built.
What is the difference between stdio and Streamable HTTP in MCP?
With stdio, the client launches the server as a local subprocess and talks to it over standard input and output, with no network involved. With Streamable HTTP, the server runs as a web service that clients reach by URL. That makes it usable from anywhere, but it needs proper authentication.
Why does my MCP server not show up in Claude Desktop?
The usual causes are relative paths in claude_desktop_config.json, a command such as uv that the app can't find on its PATH, or not fully quitting Claude after editing the config. Use absolute paths and restart Claude with Cmd+Q on a Mac. Then check the mcp log files in ~/Library/Logs/Claude/ for the actual error.
What is FastMCP?
FastMCP is a high-level Python API for building MCP servers, where each tool is a decorated function. Version 1 was merged into the official MCP Python SDK and is imported from mcp.server.fastmcp. A separately maintained FastMCP project adds deployment and auth features on top.
Is it safe to connect an MCP server to my WordPress admin?
It is as safe as the credentials and permissions you give it. Use an application password for a dedicated user account with only the role it needs, and keep the site on HTTPS. Revoke the password if the machine running the server is ever compromised.
Sources
- Introducing the Model Context Protocol | Anthropic
- Transports, MCP Specification 2025-06-18 | Model Context Protocol
- Sampling, MCP Specification 2025-06-18 | Model Context Protocol
- MCP Python SDK | Model Context Protocol on GitHub
- MCP Inspector | Model Context Protocol on GitHub
- REST API Handbook | WordPress Developer Resources