· mcp · model context protocol · tutorial · अप्रैल 2026 ·

MCP server tutorial 2026: install, configure, run

// figure MCP server lifecycle — config से Claude के tool call तक
MCP server lifecycle diagram एक horizontal flow में चार boxes: settings.json config, server process spawn, tool registration, Claude tool call. Arrows हर stage को left to right connect करते हैं. SETTINGS.JSON CONFIG ~/.claude/ या project SERVER PROCESS SPAWN npx / node / uvx TOOL LIST REGISTERED tools/list handshake CLAUDE CALLS tools/call JSON-RPC over stdio
// FILED MCP · Tutorial // SOURCE Septim Labs // PERMALINK /blog/mcp-server-tutorial-2026.html cite this →
E
लेखक: Septim Labs team
28 अप्रैल, 2026 को published
अपना tool ढूँढें →
संक्षेप में
  • MCP (Model Context Protocol) एक open standard है जो Claude Code को external tools — databases, browsers, APIs — एक consistent JSON-RPC interface के ज़रिए call करने देता है. Servers local processes के रूप में चलते हैं; Claude उन्हें stdio के ज़रिए call करता है.
  • Configuration .claude/settings.json (project-level) या ~/.claude/settings.json (global) में रहती है. हर server entry में एक command, args, और credentials के लिए environment variables चाहिए होते हैं.
  • पहले install करने लायक पाँच servers: Filesystem, Memory, GitHub, Playwright, और Fetch. हर एक उस capability gap को भरता है जिसे stock Claude Code नहीं भर सकता.

MCP असल में है क्या

Model Context Protocol — एक specification जो Anthropic ने नवंबर 2024 में publish की थी. यह language models के लिए external tools call करने का — और external tools के लिए ख़ुद को models के सामने expose करने का — एक standard तरीका define करती है. MCP से पहले हर AI tool integration custom होता था; MCP integrations को composable बनाता है.

Architecture नाम से जितनी जटिल लगती है, उतनी है नहीं. MCP server एक ऐसा process है जो आपकी machine पर (या remotely, hosted servers के लिए) चलता है. जब Claude Code start होता है, तो वह हर configured MCP server launch करता है, उस server के provided tools की list receive करता है, और फिर session के दौरान उन tools को नाम से call कर सकता है. सारी communication stdin/stdout के ऊपर JSON-RPC 2.0 के साथ होती है. Local servers के लिए कोई HTTP नहीं, कोई ports नहीं, कोई network configuration नहीं.

Deeper conceptual treatment के लिए MCP क्या है primer देखें. यह post practical setup पर focused है.

Config कहाँ रहती है

MCP server configuration एक settings.json file में रहती है. दो locations हैं:

Project-specific servers (एक database server जो किसी एक project के connection string के लिए scoped हो) के लिए project-level file को prefer करना चाहिए. जिन servers को आप everywhere चाहते हैं (Fetch, GitHub), उनके लिए global file है.

Security note

Project directory की .claude/settings.json file को .gitignore में होना चाहिए अगर उसमें credentials हैं. CVE-2026-21852 disclosure में npm के ज़रिए credentials इसी file में ship हो रहे थे. Credentials leak prevention guide देखें.

Basic config structure

settings.json में mcpServers key एक map है — server name से server configuration तक. हर server configuration बताती है कि server process कैसे start करना है.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/directory"
      ]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_fine_grained_token_here"
      }
    },
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

इस structure पर कुछ notes:

पहले install करने वाले पाँच servers

01 Filesystem MCP

Claude Code को specific directories का read और write access देता है. इसके बिना Claude Code सिर्फ़ वही files पढ़ सकता है जो आप explicitly conversation में paste करते हैं या जो उसकी working directory में पहले से हैं. इसके साथ Claude आपका file tree navigate कर सकता है, path से arbitrary files पढ़ सकता है, और disk पर लिख सकता है.

Package name के बाद का path argument allowed root है. Project-scoped install के लिए project root pass कीजिए. अपनी home directory सिर्फ़ तब pass कीजिए जब आपको ख़ासतौर पर Claude को broadly navigate करवाना हो — और ऐसा करने से पहले security implications समझ लीजिए.

02 Memory MCP

एक local knowledge graph add करता है जो sessions के पार persist होता है. Claude facts, relationships, और observations store कर सकता है — और future sessions में source files दोबारा पढ़े बिना उन्हें retrieve कर सकता है. Default में ~/.claude-memory/ में JSON के रूप में stored.

Claude Code के पास आपका project "याद" रखने का जो सबसे क़रीबी option है, वो memory server ही है. यह automatic नहीं है — Claude को explicitly observations store करनी होती हैं — लेकिन एक बार configure हो जाए, तो ब्रेक के बाद project पर लौटने का exploration overhead काफ़ी कम हो जाता है.

03 GitHub MCP

Claude को GitHub की API का access देता है: issues और PRs पढ़ना, code search करना, issues बनाना, comments post करना, branches manage करना. एक fine-grained personal access token चाहिए — उन्हीं repositories के लिए scoped जिन तक आप Claude को access देना चाहते हैं.

{
  "github": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-github"],
    "env": {
      "GITHUB_TOKEN": "github_pat_..."
    }
  }
}

PAT को minimum repositories तक scope कीजिए. आपके account के हर repo पर write access वाला PAT एक significant credential है — उसे deploy key जितनी ही caution के साथ treat कीजिए.

04 Playwright MCP (Microsoft)

Playwright के ज़रिए Claude को एक असली browser देता है. वह pages navigate कर सकता है, click कर सकता है, forms fill कर सकता है, screenshots ले सकता है, और page structure extract कर सकता है. यह Fetch server से अलग है — Playwright JavaScript render करता है; Fetch नहीं करता.

{
  "playwright": {
    "command": "npx",
    "args": ["-y", "@playwright/mcp@latest"]
  }
}

Browser ज़रूरत पर start होता है और Claude Code का session ख़त्म होने पर बंद हो जाता है. Default में visible नहीं है — अगर इसे चलते हुए देखना है तो args में "--headed" add कीजिए.

05 Fetch MCP

Web content fetch करता है और Markdown में convert करता है. ऐसी pages के लिए जिनमें JavaScript rendering नहीं चाहिए — documentation sites, GitHub READMEs, blog posts — Playwright से lighter है. Anthropic के official reference set का हिस्सा.

{
  "fetch": {
    "command": "uvx",
    "args": ["mcp-server-fetch"]
  }
}

इस server के लिए uvx चाहिए (Astral का Python package runner). इसे pip install uv से install कीजिए या Astral की install instructions follow कीजिए. अगर आप Node में रहना चाहते हैं, तो community npm wrappers मौजूद हैं, लेकिन official version Python है.

Septim Vault — $29 pay-once

एक pre-built MCP configuration pack: settings.json में paste करने के लिए तैयार आठ server configs, credentials templates, path allowlist guidance, और हर server के लिए एक verification checklist. हर server की setup documentation ढूँढ़ने का काम छोड़ दीजिए.

Septim Vault लें — $29 → या minimal config toolkit के लिए Septim Tether ($19) try कीजिए →

Server काम कर रहा है — कैसे verify करें

settings.json edit करने के बाद एक नया Claude Code session start कीजिए. Prompt पर Claude से available tools list करने को कहिए:

आपके पास कौनसे MCP tools का access है?

Claude को आपके configured servers और उनके available tools list करने चाहिए. अगर कोई server missing है, तो failure आम तौर पर तीन में से एक चीज़ है:

  1. Package install नहीं हुआ. npx पर -y flag उसे install करेगा, लेकिन पहली run तब fail हो सकती है जब npm की registry slow हो या आपके network में firewall हो. Error देखने के लिए terminal में npx command manually चलाइए.
  2. Path ग़लत है. Filesystem server एक absolute path लेता है. Relative path या typo वाला path startup failure देगा. Claude Code MCP server errors को ~/.claude/logs/ में log करता है — पहले वहीं check कीजिए.
  3. Credential invalid है. अगर server start हो जाता है लेकिन उसके tools errors return करते हैं, तो सबसे common cause expired या misconfigured API key है. MCP layer को debug करने से पहले credential को सीधे curl में या provider के API playground में test कीजिए.

Project-level vs. global configuration

Septim पर एक common pattern: global config में Fetch, Memory, और Playwright रखते हैं — ऐसे servers जो किसी भी project में useful हैं. Project-level config में Filesystem (project root को allowed path के रूप में), project का database server, और GitHub (project के repo तक scoped).

इस structure का मतलब है — आप किसी भी project directory में जा सकते हैं और Claude Code अपने आप सही servers pick up कर लेगा, manually configs toggle किए बिना. Project-level file same name वाले servers के लिए global file को override करती है, ताकि आप बिना conflict के per project अलग database connections रख सकें.

Remote MCP servers

Anthropic ने early 2026 में remote MCP servers (stdio की जगह SSE पर accessed) के लिए support add किया. इसकी configuration command और args की जगह एक url key use करती है:

{
  "mcpServers": {
    "stripe": {
      "url": "https://mcp.stripe.com",
      "headers": {
        "Authorization": "Bearer sk_live_..."
      }
    }
  }
}

उन services के लिए remote servers convenient हैं जो अपने hosted MCP endpoints maintain करती हैं (Stripe और कई दूसरे करते हैं). Tradeoff यह है — हर tool call पर एक network round-trip और credential wire के ऊपर जाता है. HTTPS-only remotes use कीजिए और authorization header को environment variable में एक API key की तरह ही treat कीजिए.

और servers add करने से पहले security पर विचार

हर add किया हुआ server आपके Claude Code session की attack surface बढ़ाता है. MCP server vulnerability checklist 24-point evaluation framework cover करती है. Tutorials के लिए short version:

चलाने लायक servers की पूरी curated list — हर एक के साथ उसकी security caveat — best MCP servers 2026 post में है.

Septim Vault — $29 · 8 pre-built MCP configs

आठ server configurations, credentials templates, path allowlist guidance, और एक verification checklist. CVE-2026-21852 post से settings.json security hardening guide भी शामिल. Pay once.

Septim Vault खरीदें — $29 → Septim Tether ($19) — minimal MCP config toolkit →