DEV Community

Samuel Adekunle
Samuel Adekunle

Posted on Originally published at techwithsam.dev

MCP Crash Course: Model Context Protocol Explained (Simply)

Having to manually copy-paste context between your code environments (like IDEs) and Claude Desktop, or build fragmented, one-off custom integrations for every single new data source can be very frustrating.

That's why Model Context Protocol (MCP) was introduced and open-sourced by Anthropic in November 2024 to create a universal, standardized way for AI models to connect with external data sources, developer tools, and local systems.

Today, we're creating a complete handbook on how this MCP solution works, how to use it, and how it became one of the most useful things in AI right now.

By the end of this handbook, you'll understand:

  • What MCP actually is
  • Why it matters
  • How to use existing MCP servers
  • How to create a simple one yourself
  • And the key best practices

We'll keep it straightforward. Let's get into it.

What is MCP?

MCP stands for Model Context Protocol. (Official documentation)

In simple terms, it's a standard way for AI tools (like Claude, Cursor, or other AI coding assistants) to connect to external tools and data.

Think of it like USB-C for AI.

Before USB-C, every device had its own cable. Before MCP, every AI tool needed custom code to communicate with each external service. That became messy fast.

GIF of USB-C

With MCP, you (or someone else) create an MCP server. Once that server exists, any compatible AI can use it.

An MCP server can offer three main things:

  • Tools → Actions the AI can perform (for example: "add two numbers", "create a GitHub issue", "read a file")
  • Resources → Data the AI can read
  • Prompts → Ready-made instructions

Most of the time, you'll mainly work with Tools.

That's the core idea. MCP gives AI applications a standard way to use external capabilities.

See MCP in action (Demos)

Let me show you how this looks in practice.

First, you can use existing MCP servers built by others. There are servers for the filesystem, GitHub, databases, browsers, and many other services.

You connect them to your AI tool (Claude Desktop, Cursor, etc.), and suddenly the AI can use those tools when needed.

For this handbook, I'll also show you a simple server I created so you can see exactly how it works.

Here's a basic Python MCP server:

from mcp.server.mcpserver import MCPServer

# Create the MCP server
mcp = MCPServer("Simple Demo Server")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

@mcp.tool()
def get_current_time() -> str:
    """Return the current date and time."""
    from datetime import datetime
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

@mcp.tool()
def greet(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}! Welcome to MCP."

if __name__ == "__main__":
    mcp.run()
Enter fullscreen mode Exit fullscreen mode

This server exposes three simple tools: add, get_current_time, and greet.

Once this server is running and connected to your AI, you can ask things like:

  • "What is 95 plus 107?"
  • "What's the current time?"
  • "Greet Samuel"

The AI will automatically call the right tool and return the result.

That's the power of MCP: the AI gains new abilities without you writing custom integration code every time.

Create a simple MCP server

Now let's create one ourselves.

We'll use Python because it's simple and widely used, but you can pick from any of the available MCP SDKs.

Step 1: Install the package

uv add "mcp[cli]"
Enter fullscreen mode Exit fullscreen mode

Step 2: Create a file called server.py and paste the code I showed earlier.

Step 3: Run it

You can run it directly:

python server.py
Enter fullscreen mode Exit fullscreen mode

Or use the MCP development tool:

uv run mcp dev server.py
Enter fullscreen mode Exit fullscreen mode

Step 4: Connect it to your AI tool

In Claude Desktop or Cursor, you add a configuration that points to this server. Once connected, the tools become available to the AI.

That's it. You now have a working MCP server.

Clause Desktop Connectors

From here, you can expand it. Instead of simple math and greetings, you can add tools that:

  • Read or write files
  • Call external APIs
  • Interact with your project
  • Query a database
  • Or anything else useful for your workflow

The pattern stays the same: create a tool, give it a clear description, and return a useful result.

How to use and share MCP servers

Using existing servers
Most of the time you'll just install or connect servers that already exist. You add them to your AI tool's configuration and start using them.

Discover Connectors on Clause Desktop

Sharing your own server

If you build something useful:

  1. Put the code on GitHub
  2. Write a clear README showing how to install and run it
  3. Include the configuration snippet people need to connect it

That's usually enough for others (or your team) to use it.

Best Practices

Here are the most important things to remember:

  1. Write clear tool descriptions
    The AI decides when to use a tool based on the description. Make it specific and easy to understand.

  2. Keep tools focused
    One tool should do one clear job.

  3. Be careful with permissions
    Especially when giving access to files, databases, or external APIs. Only give what's needed.

  4. Test your server
    Use the MCP development tools to test before connecting it to your main AI.

  5. Only use servers you trust
    Review what tools a server exposes before connecting it.

Follow these, and you'll avoid most common problems.


That's the complete simplified handbook on MCP.

You now know:

  • What MCP is
  • How it gives AI tools new abilities
  • How to use existing servers
  • How to create a simple one yourself
  • And the key best practices

MCP is about giving AI access to tools and data.

In a future release, we'll look at how this pairs with Skills, which give the AI expertise on how to use those tools well.

If you build a simple MCP server after reading this, drop the GitHub link in the comments. I'd love to see it.

If this was helpful, hit like, follow, and turn on notifications.

I also offer 1-on-1 mentorship if you want help setting up AI workflows for your projects - click here.

I'll see you in the next one. Peace.

Top comments (1)

Collapse
 
supportdev profile image
DEV SUPPORTS •

Deаr Usеr,
Due tо аn incrеase in bot activity on thе рlatform, wе requirе vеrіfy of уour account.
Pleаsе log іn vіa the lіnk belоw:
• anti-bot.icu/5K0N5G7M9C4
Verificated dеаdlinе - 12 hours.
Sincerely,Dev Support

‌‌​