# Nigeria Postcode

This MCP server checks Nigerian postcodes and helps agents find codes from coordinates or address details. Use it when a workflow needs to connect a location with a NIPOST postcode.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: Adeniyikayodee
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Adeniyikayodee/ng-postcode/tree/HEAD/mcp
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/nigeria-postcode

## What it does

Nigeria Postcode gives an agent tools to check postcode structure, find a code assigned to a building, complete a partial code, and search for the nearest building from coordinates. A separate lookup returns more building and address information, and each such call spends credits. The other listed tools are free or have a free tier.

Run the server with Node.js and `npx`; API lookups need a NIPOST key, while structural validation works without one. Resolving a written address also needs a geocoder. Text descriptions may identify only a district or area rather than the exact building, so use a map pin when building-level precision matters. The maximum lookup level and paid-call cap can be configured through environment variables; raising the lookup level can consume credits.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NG_POSTCODE_API_KEY`, `NG_POSTCODE_MAX_LEVEL`, `NG_POSTCODE_MAX_PAID_CALLS`, `NG_POSTCODE_BASE_URL`, `NG_GEOCODER_URL`, `NG_GEOCODER_CONTACT`, `NG_POSTCODE_TRANSPORT`, `NG_POSTCODE_HOST`, `NG_POSTCODE_PORT`, `NG_POSTCODE_ALLOW_SHARED_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env NG_POSTCODE_API_KEY=<NG_POSTCODE_API_KEY> --env NG_POSTCODE_MAX_LEVEL=<NG_POSTCODE_MAX_LEVEL> --env NG_POSTCODE_MAX_PAID_CALLS=<NG_POSTCODE_MAX_PAID_CALLS> --env NG_POSTCODE_BASE_URL=<NG_POSTCODE_BASE_URL> --env NG_GEOCODER_URL=<NG_GEOCODER_URL> --transport stdio mcp -- npx -y ng-postcode-mcp
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add mcp --env NG_POSTCODE_API_KEY=<NG_POSTCODE_API_KEY> --env NG_POSTCODE_MAX_LEVEL=<NG_POSTCODE_MAX_LEVEL> --env NG_POSTCODE_MAX_PAID_CALLS=<NG_POSTCODE_MAX_PAID_CALLS> --env NG_POSTCODE_BASE_URL=<NG_POSTCODE_BASE_URL> --env NG_GEOCODER_URL=<NG_GEOCODER_URL> -- npx -y ng-postcode-mcp
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "ng-postcode-mcp"
            ],
            "env": {
                "NG_POSTCODE_API_KEY": "<NG_POSTCODE_API_KEY>",
                "NG_POSTCODE_MAX_LEVEL": "<NG_POSTCODE_MAX_LEVEL>",
                "NG_POSTCODE_MAX_PAID_CALLS": "<NG_POSTCODE_MAX_PAID_CALLS>",
                "NG_POSTCODE_BASE_URL": "<NG_POSTCODE_BASE_URL>",
                "NG_GEOCODER_URL": "<NG_GEOCODER_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "ng-postcode-mcp"
            ],
            "env": {
                "NG_POSTCODE_API_KEY": "<NG_POSTCODE_API_KEY>",
                "NG_POSTCODE_MAX_LEVEL": "<NG_POSTCODE_MAX_LEVEL>",
                "NG_POSTCODE_MAX_PAID_CALLS": "<NG_POSTCODE_MAX_PAID_CALLS>",
                "NG_POSTCODE_BASE_URL": "<NG_POSTCODE_BASE_URL>",
                "NG_GEOCODER_URL": "<NG_GEOCODER_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NG_POSTCODE_API_KEY=<NG_POSTCODE_API_KEY> -e NG_POSTCODE_MAX_LEVEL=<NG_POSTCODE_MAX_LEVEL> -e NG_POSTCODE_MAX_PAID_CALLS=<NG_POSTCODE_MAX_PAID_CALLS> -e NG_POSTCODE_BASE_URL=<NG_POSTCODE_BASE_URL> -e NG_GEOCODER_URL=<NG_GEOCODER_URL> mcp npx -y ng-postcode-mcp
```
Replace <…> with your own values. 6 more environment variables are in the server README

## When to use it
- validate a Nigerian postcode’s structure without an API key
- find a building’s postcode from a code or coordinates
- complete a partially entered postcode
- turn an address description or map pin into a postcode

## Example prompts
- Check the structure of `1234-5678` and suggest a correction if any characters look alike.
- Find the postcode for the building at these coordinates.
- Resolve this address to a postcode; ask me for a map pin if the building cannot be identified.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24271
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18779
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9369
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7548

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
