Skip to content

how to setup and test a `hello world` mcp server on my local host?

Purpose

When I learn mcp server, I just want a hello world mcp server to run in my local machine. But I don’t know how to do it. I have Googled and found nothing, so I decided to write a post to share my experience.

Here is the diagram that shows the hello world mcp server test environment: Just as the above picture shows:

  • I will use roo code plugin in vscode to test the AI and mcp server.
  • The roo code plugin will use the openrouter deepseek free api.
  • I will use the local mcp server(named filesystem) for test.

Prerequisites

  • A computer with vscode and roo code plugin installed , you can refer to this video

  • You have installed latest npx and node on your computer Here is the success npx installation example:

Terminal window
npx --version
11.1.0
  • You have configured your roo code’s LLM api provider like this: If you don’t know how to get a openrouter api key, you can refer to this document

How to setup a mcp server locally?

After install roo code plugin in vscode, you should see this in your vscode:

Then click the settings button in the top-right corner, and choose “MCP servers” as shown in the picture below:

Here you can see the mcp servers you have configured, and you can add a new one by clicking the ‘mcp marketplace’ button:

then search for filesystem and click the ‘install’ button:

At last, you return to the mcp servers page, you can see the new mcp server you have installed:(note: you need to refresh the page, and the filesystem mcp server’s status should be green)

Now you have your first mcp server installed , but if you want to use it, you need to configure its allowd path on you local machine, here are the steps:

First , you need to open the mcp server’s config page, and click the Edit Global MCP button:

Then you can see the mcp server’s config content, it’s a json file, you can edit it, find the filesystem part and add your allowed paths to it: btw, you can add more than one path to the filesystem mcp server. Here is the example json:

"Filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"~/temp",
"~/Downloads"
],
"env": {},
"disabled": false,
"alwaysAllow": [
"read_file",
"read_multiple_files",
"list_directory",
"list_directory_with_sizes",
"search_files",
"get_file_info",
"list_allowed_directories"
]
},
...

Now your first mcp server is ready to use.

How to use the mcp server

Before testing the mcp server, we should know more about it.

The filesystem MCP server is a cool example of the Model Context Protocol (MCP). Think of it as a helpful assistant that lets your AI models safely and easily work with your local files right on your computer.

What Can the filesystem MCP Server Do?

This server basically gives your filesystem MCP server the ability to read/write files and folders, just like you would. Here’s a quick rundown of what it enables:

  • Read/write files
  • Create/list/delete directories
  • Move files/directories
  • Search files
  • Get file metadata
  • Dynamic directory access control via Roots

Now, let’s test it in vscode’s roo code plugin, Open your roocode in your vscode, and input this in the input box: (suppose we have a file named humor.txt in ~/temp/ directory)

help me rename the file ~/temp/humor.txt to ~/temp/test.txt

Here is the output: You can see that the roo code have use LLM to find the right mcp tool to use for my task.

Then roocode calls the mcp tool and pass the result to LLM , and we get the final result:

And the file really changed:

Terminal window
ll ~/temp/*.txt
-rw-r--r--@ 1 bswen staff 170B Jul 23 16:02 /Users/bswen/temp/test.txt

Theory

what is mcp ?

Imagine an AI, like a really smart assistant, that needs to do more than just answer questions based on what it was originally taught. It needs to access new information, use real-time data, and interact with various tools (like a calendar, a database, or a web search engine).

The Model Context Protocol (MCP) is essentially a standardized way for AI applications to connect with these external services and data sources.

Think of it like this:

  • Before MCP: Every time an AI wanted to talk to a new tool or retrieve data from a new place, developers had to build a custom “adapter” for that specific connection. It was like having a different type of plug for every single appliance – messy and inefficient.

  • With MCP: MCP is like a universal USB-C port for AI. It provides a common “language” and “plug” so that AI models can easily connect to any compatible tool or data source without needing a new custom integration every time.

In simple words, MCP makes it “plug-and-play” for AI to:

  • Get up-to-date information: Instead of just relying on its training data (which might be old), the AI can fetch real-time data from databases, the internet, etc.

  • Use tools: It can interact with external tools to perform actions, like scheduling a meeting, generating a report, or sending an email.

  • Understand context: It helps the AI understand the relevant information and data needed for a specific task, providing a richer “context” for its responses and actions.

This standardization is crucial for building more capable and flexible AI applications and agents that can truly interact with the real world.

what is roo code ?

Roo Code is a VS Code extension that supercharges your coding with AI.

Think of it as an AI coding assistant directly in your editor. It uses large language models (LLMs) to:

  • Generate and refactor code from natural language descriptions.

  • Debug and fix issues.

  • Run terminal commands and automate tasks.

  • Understand your project context to provide more relevant help.

  • Customize its behavior with different “modes” (like “Architect” or “Debug”).

It aims to make software development more efficient by bringing AI capabilities right into your daily workflow.

Summary

In this post, I have explained how to use setup and run your first mcp server using vscode/roo, the key point is to correctly setup the roocode env and mcp server configuration to make the mcp run locally.

Final Words + More Resources

My intention with this article was to help others who might be considering solving such a problem. So I hope that’s been the case here. If you still have any questions, don’t hesitate to ask me by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!