Search This Blog

Tuesday, May 12, 2026

How to Add an MCP Server to Claude in VS Code

If you’re using Claude with Visual Studio Code and want to connect external tools like GitHub, databases, Notion, Slack, or your local filesystem, MCP (Model Context Protocol) is the feature you need.

This guide walks through how to add an MCP server to Claude inside VS Code step by step.

What is MCP?
MCP (Model Context Protocol) allows Claude to connect with external tools and services.

With MCP servers, Claude can:

- Read and edit files
- Access GitHub repositories
- Query databases
- Interact with APIs
- Connect to productivity tools
- Automate browser tasks

Prerequisites:

Before starting, make sure you have:
- Node.js installed
- Visual Studio Code installed
- Claude Code CLI access

Step 1: Install Claude Code

Open your terminal and install Claude Code globally:

npm install -g @anthropic-ai/claude-code

After installation, launch Claude once with following command:

claude

Step 2: Add an MCP Server

To add a Local Filesystem MCP Server, run:

claude mcp add filesystem npx @modelcontextprotocol/server-filesystem .

To add an HTTP MCP Server, run:

claude mcp add --transport http myserver https://example.com/mcp

Step 3: Verify MCP Servers

To see all configured MCP servers, run following:

claude mcp list

Inside Claude Code, you can also type:

/mcp

Step 4: Open VS Code

Navigate to your project:

code .

Inside the VS Code terminal, launch Claude:

claude

Step 5: Create a Shared .mcp.json Configuration
Create a file named .mcp.json with the following:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/server-filesystem",
        "."
      ]
    }
  }
}

Popular MCP Servers Developers Use

- Filesystem
- GitHub
- PostgreSQL
- Notion
- Slack
- Puppeteer
- Docker
- Jira


Example: Add GitHub MCP Server

claude mcp add github npx @modelcontextprotocol/server-github

Troubleshooting

If MCP servers are not showing, restart Claude:

exit
claude

Then verify again:

claude mcp list

Final Thoughts

MCP transforms Claude from a standalone AI assistant into a fully integrated development companion. Once connected, Claude can work directly with your files, repositories, databases, and developer tools — all from inside VS Code.


Cheers,
Kapil

Wednesday, January 29, 2025

How to use PM2 to Manage Multiple Node Services in production

 If you want to manage and monitor the services, you can use PM2, a process manager for Node.js. This is particularly useful in production environments.

  1. Install PM2 globally:


    npm install pm2 -g
  2. Create an ecosystem file (e.g., ecosystem.config.js) to define all services:


    module.exports = { apps: [ { name: 'microservice1', script: './microservice1/server.js', watch: true, env: { NODE_ENV: 'production', }, }, { name: 'microservice2', script: './microservice2/server.js', watch: true, env: { NODE_ENV: 'production', }, }, { name: 'microservice3', script: './microservice3/server.js', watch: true, env: { NODE_ENV: 'production', }, }, ], };
  3. Start all services:


    pm2 start ecosystem.config.js
  4. Monitor services:

    pm2 list
Cheers,

Kapil 

How can package all microservices using docker

 If each of your microservices is containerized using Docker, you can use Docker Compose to define and run all of your services in one go. This is one of the most common ways to manage multiple microservices.

Steps:

  1. Create Dockerfiles for each microservice (if you haven't already): Each microservice should have its own Dockerfile to build the image. For example:

    dockerfile:
    # Dockerfile for microservice 1 FROM node:14 WORKDIR /app COPY . . RUN npm install CMD ["npm", "start"
  2. Create a docker-compose.yml file at the root of your project: This will define all your microservices and how they interact.


    version: "3" services: microservice1: build: context: ./microservice1 ports: - "3001:3001" environment: - NODE_ENV=production microservice2: build: context: ./microservice2 ports: - "3002:3002" environment: - NODE_ENV=production microservice3: build: context: ./microservice3 ports: - "3003:3003" environment: - NODE_ENV=production
  3. Run all services with Docker Compose:

    • In the root directory where your docker-compose.yml file is, simply run:

    docker-compose up --build

    This command will build the Docker images (if necessary) and start all the services.

  4. Stopping the services:


    docker-compose down
Cheers,
Kapil 

Popular Posts