McpGetting Started

Getting Started with Model Context Protocol (MCP)

This guide will walk you through installing, configuring, and using MCP servers with Claude Code to extend its capabilities with external data sources and tools.

8 min read

Getting Started with Model Context Protocol (MCP)

This guide will walk you through installing, configuring, and using MCP servers with Claude Code to extend its capabilities with external data sources and tools.

Time: 30-45 minutes Prerequisites: Claude Code installed, basic command line knowledge


What You'll Learn

  • Install your first MCP server
  • Configure Claude Code to use MCP
  • Access databases via MCP
  • Use GitHub integration via MCP
  • Create your own custom MCP server
  • Troubleshoot common issues

Installation

Prerequisites

Ensure Claude Code is Installed:

Install Node.js (for MCP servers):


Your First MCP Server: Filesystem

Let's start with the filesystem MCP server to give Claude Code access to your files.

Step 1: Install the Filesystem MCP Server

The filesystem server is pre-installed with Claude Code, we just need to configure it.

Step 2: Configure in Claude Code

Edit your Claude Code settings file:

Location:

  • User-level: ~/.claude/settings.json
  • Project-level: .claude/settings.json (in your project directory)

Add MCP Configuration:

Important: Replace paths with directories you want Claude to access.

Step 3: Test the Connection


Install GitHub MCP Server

Connect Claude Code to your GitHub repositories.

Step 1: Create a GitHub Personal Access Token

  1. Go to https://github.com/settings/tokens
  2. Click "Generate new token" → "Generate new token (classic)"
  3. Give it a name: "Claude Code MCP"
  4. Select scopes:
    • repo (full control of private repositories)
    • read:org (read org data)
  5. Click "Generate token"
  6. Copy the token (you won't see it again!)

Step 2: Install and Configure GitHub MCP Server

Option A: Using CLI

Option B: Manual Configuration

Edit ~/.claude/settings.local.json (for sensitive credentials):

Step 3: Use GitHub Integration


Install Database MCP Server (PostgreSQL)

Connect Claude Code to your PostgreSQL database.

Step 1: Install PostgreSQL MCP Server

Step 2: Configure Database Access

Edit ~/.claude/settings.local.json:

Security Note: Use settings.local.json (not tracked in git) for credentials.

Step 3: Query Your Database


Install SQLite MCP Server

For local database files.

Configuration


Install Slack MCP Server

Send messages and interact with Slack.

Step 1: Create Slack App

  1. Go to https://api.slack.com/apps
  2. Click "Create New App" → "From scratch"
  3. Name it "Claude Code MCP"
  4. Select your workspace
  5. Add OAuth Scopes:
    • chat:write - Send messages
    • channels:read - List channels
    • users:read - List users
  6. Install to workspace
  7. Copy the "Bot User OAuth Token"

Step 2: Configure Slack MCP

Step 3: Use Slack


Managing MCP Servers

List Configured Servers

Output:

Test a Specific Server

Disable a Server Temporarily

Edit settings.json and comment out or remove the server configuration.

Debug MCP Connection Issues


Configuration Scopes

User-Level (~/.claude/settings.json)

  • Global settings for all projects
  • Non-sensitive configuration

User-Local (~/.claude/settings.local.json)

  • Global settings with secrets (API keys, passwords)
  • Not committed to version control

Project-Level (.claude/settings.json)

  • Project-specific MCP servers
  • Shared with team via git

Project-Local (.claude/settings.local.json)

  • Project-specific secrets
  • Not committed to version control
  • Overrides project settings

Priority: Project-Local > Project > User-Local > User


Security Best Practices

Never Commit Secrets

Use Environment Variables

Then set in your shell:

Principle of Least Privilege

  • Only grant necessary permissions to MCP servers
  • Use read-only tokens when possible
  • Limit filesystem access to specific directories

Use Project-Specific Credentials

For team projects, each developer should use their own credentials in .claude/settings.local.json.


Common MCP Servers Reference

Development Tools

Git:

GitLab:

Search & Web

Brave Search:

Web Fetch:


Troubleshooting

Issue: "MCP server not found"

Solution:

Issue: "Connection refused"

Solution: Check your configuration:

Issue: "Authentication failed"

Solution:

  • Verify API token is correct
  • Check token permissions/scopes
  • Ensure token hasn't expired
  • Test token outside of Claude Code

Issue: "Server crashes immediately"

Solution:


Next Steps

Immediate (Today)

  1. ✅ Configure filesystem MCP server
  2. ✅ Install one database MCP server
  3. ✅ Test GitHub integration
  4. ✅ Explore available MCP servers

Short-term (This Week)

  1. Best Practices - Secure configuration patterns
  2. Use Cases - Real-world MCP applications
  3. Tutorial 1 - Build your own MCP server

Medium-term (This Month)

  1. Build a custom MCP server for your internal tools
  2. Share MCP configuration with your team
  3. Integrate multiple MCP servers into workflows
  4. Contribute to MCP ecosystem

Quick Reference

Essential Commands

Configuration Template


Resources


Ready to build your own MCP server?Tutorial 1: Build a Custom MCP Server

Want to see real-world examples?MCP Use Cases

Need advanced patterns?MCP Best Practices


← Back to MCP Overview | Next: Use Cases →

Stay in the loop

Get weekly insights on data engineering, analytics, and AI—delivered straight to your inbox.

No spam. Unsubscribe anytime.