DevInterviewMasterStart free →
AI & AutomationFree to read

Building MCP Servers

Plug AI Into Your Entire Tech Stack

Learn how to configure and use pre-built MCP servers that connect AI to your filesystem, GitHub repositories, databases, web browsers, and more. Turn your AI assistant into a power tool that can actually do things.

What Are Pre-Built MCP Servers?

Ready-Made Plugins That Give AI Superpowers

The App Store of AI Tools:

Pre-built MCP servers are ready-to-use integrations that connect your AI client (Claude Desktop, Cursor, etc.) to real-world tools and services. You do not need to write code - just configure them and your AI can suddenly access files, manage GitHub repos, query databases, and browse the web.

Think of it like installing apps on your phone. Your phone can make calls, but install WhatsApp and it can message. Install Paytm and it can pay. Each MCP server adds a new ability to your AI.

Real-World Analogy - Swiggy Kitchen Partners:

Swiggy does not cook food. It connects customers to thousands of restaurants (partners). Each restaurant has its own menu and kitchen, but Swiggy provides the standard interface (app, delivery). MCP clients are like Swiggy - they do not have the tools themselves, they connect to MCP servers (restaurants) that do the actual work.

The MCP Server Ecosystem:

  • 1000+ servers available on GitHub, npm, and the official MCP registry
  • Official servers maintained by Anthropic: filesystem, GitHub, GitLab, Google Drive, Slack, PostgreSQL, etc.
  • Community servers for everything from Jira to Notion to AWS to stock trading
  • Custom servers you build for your own internal tools

Note: You do not need to build anything to start using MCP. Configure pre-built servers and your AI gets instant access to powerful tools.

Filesystem MCP Server

Give AI Access to Your Local Files

What It Does:

The Filesystem MCP server gives your AI the ability to read, write, search, and manage files on your local computer. It is one of the most commonly used MCP servers because so much of our work involves files.

Available Tools:

  • read_file: Read the contents of any file in allowed directories
  • write_file: Create or overwrite a file
  • edit_file: Make targeted edits to specific parts of a file
  • list_directory: See all files and folders in a directory
  • search_files: Search for files by name pattern across directories
  • get_file_info: Get metadata like size, creation date, permissions
  • move_file: Move or rename files
  • create_directory: Create new folders

Security - Directory Allowlisting:

The filesystem server requires you to specify allowed directories. The AI can ONLY access files within those directories. If you allow /Users/you/projects, the AI cannot read /Users/you/passwords. This is a critical security boundary.

// Configuration example (Claude Desktop)
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem",
              "/Users/you/projects", "/Users/you/documents"]
    }
  }
}

Example Workflow:

You: "Read my package.json and tell me what dependencies are outdated"

AI Agent:
  1. Calls read_file("/Users/you/projects/app/package.json")
  2. Parses the JSON content
  3. Analyzes dependency versions
  4. Reports: "react is at 18.2, latest is 19.1. express at 4.18, latest is 5.0..."

Note: Always use the narrowest directory permissions possible. Do not allow your entire home directory - only specific project folders the AI needs.

GitHub & Git MCP Servers

AI-Powered Repository Management

What It Does:

The GitHub MCP server connects your AI to the GitHub API. It can manage repositories, pull requests, issues, code reviews, and more - all through natural language commands.

Key Tools Available:

  • search_repositories: Find repos matching a query
  • get_file_contents: Read files from any repo
  • create_or_update_file: Commit changes directly
  • create_pull_request: Open PRs with title, body, and branch
  • list_issues / create_issue: Manage project issues
  • push_files: Push multiple file changes in one commit
  • create_branch: Create new branches from any ref
  • search_code: Search code across all of GitHub

Configuration:

Requires a GitHub Personal Access Token with appropriate permissions:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Powerful Use Cases:

  • "Review the latest PR on my repo and suggest improvements"
  • "Create an issue for the bug I just found with reproduction steps"
  • "Search all repos in our org for any usage of deprecated API v2"
  • "Create a branch, fix the typo in README, and open a PR"

Note: Use fine-grained personal access tokens with minimum required permissions. Never give full admin access if you only need read access to repos.

Database & Web MCP Servers

Query Databases and Browse the Web with AI

PostgreSQL / SQLite MCP Server:

Connect your AI directly to your database. It can inspect schemas, run SELECT queries, and analyze data - all through conversation. Perfect for data exploration and quick analytics.

  • list_tables: See all tables in the database
  • describe_table: Get column names, types, constraints
  • read_query: Execute SELECT queries (read-only for safety)
  • append_insight: Save analysis insights as memos

Important: Most DB servers are read-only by default. Write operations require explicit configuration. This prevents accidental data mutations.

Web Search & Browser MCP Servers:

Give your AI the ability to search and browse the web in real-time:

  • Brave Search MCP: Web search using Brave API. Great for fact-checking and research.
  • Fetch / Web MCP: Fetch and read any webpage content. AI can extract information from URLs.
  • Puppeteer MCP: Full browser automation - click buttons, fill forms, take screenshots. For complex web interactions.

Configuration Examples:

// PostgreSQL MCP Server
{
  "postgres": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-postgres",
            "postgresql://user:pass@localhost/mydb"]
  }
}

// Brave Search MCP Server
{
  "brave-search": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-brave-search"],
    "env": {
      "BRAVE_API_KEY": "your_brave_api_key"
    }
  }
}

Example Interaction:

You: "How many users signed up last week? Compare with the week before."

AI Agent:
  1. Calls describe_table("users") to understand schema
  2. Calls read_query("SELECT COUNT(*) FROM users WHERE created_at > ...")
  3. Calls read_query again for the previous week
  4. Reports: "Last week: 342 signups. Week before: 289. That is 18% growth!"

Note: Never expose production databases directly to AI without read-only restrictions. Use a read replica or a limited database user with SELECT-only permissions.

Multi-Server Setups & Real-World Workflows

Combining Multiple MCP Servers for Powerful Workflows

The Power of Multiple Servers:

The real magic happens when you configure multiple MCP servers together. Each server adds capabilities, and the AI can chain them to solve complex tasks. It is like having a team of specialists that can collaborate.

Developer Workflow Setup:

Your AI has access to:
  - Filesystem MCP    (read/write local code)
  - GitHub MCP        (manage repos, PRs, issues)
  - PostgreSQL MCP    (query your dev database)
  - Brave Search MCP  (search web for docs)

Workflow Example:
You: "The login API is returning 500 errors.
      Check the error logs, find the bug, fix it,
      and create a PR."

AI Agent:
  1. Reads log files via Filesystem MCP
  2. Identifies the error: null pointer in auth middleware
  3. Searches web for the error pattern via Brave Search
  4. Reads the source file via Filesystem MCP
  5. Fixes the code and writes the file
  6. Creates a branch and PR via GitHub MCP
  7. Reports: "Fixed! PR #47 created with the auth fix."

Data Analyst Workflow:

Your AI has access to:
  - PostgreSQL MCP    (query analytics DB)
  - Filesystem MCP    (save reports)
  - Google Drive MCP  (upload to shared drive)

You: "Generate the monthly sales report for February
      and share it with the team."

AI Agent:
  1. Queries sales data via PostgreSQL MCP
  2. Calculates totals, comparisons, trends
  3. Writes a formatted report file via Filesystem MCP
  4. Uploads to shared drive via Google Drive MCP
  5. Reports: "February report generated and uploaded!"

Tips for Multi-Server Configuration:

  • Each server is independent - if one crashes, others keep working
  • Name servers clearly so you can identify them in logs
  • Start with 2-3 servers and add more as needed. Too many servers can slow down initialization.
  • Test each server individually before combining them

Note: The best AI workflows combine 3-5 MCP servers. More than 7-8 servers can slow things down as the LLM needs to process all tool descriptions.

Security Best Practices for MCP Servers

Keep Your Systems Safe While Empowering AI

Rule 1: Principle of Least Privilege

Give each MCP server the minimum access it needs. Filesystem? Only specific directories. GitHub? Only necessary repos with read-only if possible. Database? Read-only user with SELECT permissions only. Never give admin access when viewer access is enough.

Rule 2: Protect Your Secrets

API tokens, database passwords, and access keys are configured in your MCP config file. Keep this file secure. Do not commit it to Git. Use environment variables when possible. Rotate tokens regularly.

Rule 3: Review Before Approve

Most MCP clients show you what tool the AI wants to call before executing it. Always review destructive operations like file writes, PR creation, or data mutations. Do not blindly approve tool calls you do not understand.

Rule 4: Use Official Servers First

The official MCP servers maintained by Anthropic are well-tested and security-reviewed. Community servers may have vulnerabilities. Always check the source code and popularity of community servers before using them.

Note: MCP servers can access real systems with real data. Treat MCP configuration like you would treat SSH keys - with serious security consideration.

Interview Questions

Q: What is the role of pre-built MCP servers?

Pre-built MCP servers are ready-to-use integrations that connect AI clients to external services like GitHub, databases, filesystems, and web browsers. They eliminate the need to write custom integration code. You configure them once (with required credentials), and the AI can immediately use the tools they expose. There are 1000+ servers available in the ecosystem.

Q: How does the Filesystem MCP server handle security?

The Filesystem MCP server uses directory allowlisting. You explicitly specify which directories the server can access during configuration. The AI can only read/write files within those allowed directories. It cannot escape the sandbox to access other parts of the filesystem. This follows the principle of least privilege.

Q: Why are database MCP servers typically read-only by default?

Database MCP servers default to read-only mode to prevent accidental data corruption. LLMs can make mistakes or misunderstand queries. If the AI could run DELETE or UPDATE statements, a misunderstood request could destroy production data. Read-only mode (SELECT only) lets the AI analyze data safely. Write access requires explicit configuration as a conscious security decision.

Q: What happens when you configure multiple MCP servers together?

When multiple servers are configured, the AI client aggregates all tools from all servers. The LLM sees the complete list of available tools and can chain them together in a single workflow. For example: read error logs (Filesystem), search for a fix (Web Search), apply the fix (Filesystem), and create a PR (GitHub) - all in one conversation. Each server remains independent.

Q: What security best practices should you follow when configuring MCP servers?

Key practices: (1) Least privilege - minimum permissions per server. (2) Protect secrets - do not commit API keys to Git, use env vars. (3) Review tool calls - check destructive operations before approving. (4) Prefer official servers - they are security-reviewed. (5) Read-only by default for databases. (6) Narrow directory access for filesystem servers.

Frequently Asked Questions

What is Building MCP Servers?

Learn how to configure and use pre-built MCP servers that connect AI to your filesystem, GitHub repositories, databases, web browsers, and more. Turn your AI assistant into a power tool that can actually do things.

How does Building MCP Servers work?

Ready-Made Plugins That Give AI Superpowers The App Store of AI Tools: Pre-built MCP servers are ready-to-use integrations that connect your AI client (Claude Desktop, Cursor, etc.) to real-world tools and services. You do not need to write code - just configure them and your AI can suddenly access files, manage…

Browse all AI & Automation topics →

Practice this on DevInterviewMaster

Read the full Building MCP Servers breakdown with interactive demos, quizzes, and Hinglish notes.

Open the interactive topic →

800+ system-design, LLD, coding, and design-pattern topics. Unlock everything with Pro (₹499, one-time) or Ultimate (₹999, one-time) — lifetime access, no subscription.