Build Your First Useful Business MCP Server
100%
01 / 11
Contents
05

BrainIT Consulting · Free Field Guide No. 5

Build Your First Useful Business MCP Server

Go from a new computer to a tested, read-only business connection using fictional data, free tools and ChatGPT sign-in.

No API keySix verified testsComplete starter included
What you will leave withA real local MCP server that publishes one approved business profile and two read-only tools. It cannot send, schedule, change, delete, quote or contact anyone.
01

See what you are building

MCP stands for Model Context Protocol. It is a standard way for an AI application to discover approved information and narrowly described tools. It does not make every business system available to an AI.

01 PERSONYou ask“Do we offer gutter cleaning?”
02 HOSTCodex decidesIt can choose an available MCP tool.
03 SERVERYour code controlsOnly programmed resources and tools exist.
04 FILESApproved facts answerThree fictional local JSON files.

Codex is the host. The MCP connection is the client that carries structured requests and results. Your local program is the server that decides what is technically possible.

CapabilityWhat it returnsWhat it cannot do
business://profileApproved fictional business informationChange the profile
search_servicesMatches from the recorded catalogueInvent a service or price
check_service_areaExact matches from the town listBook or promise availability

The server uses STDIO: Codex starts the program and speaks through its input and output streams. It is not a public website and does not listen on a network port.

Success is observableAsk about gutter cleaning and receive the recorded fact. Ask about pool repair, an appointment or an email and the system must not pretend that the missing ability exists.
02

Draw the safety boundary first

When someone asks about the fictional business, return only approved profile, service and service-area facts. If the information is absent, say that a person must review it. Do not take an external action.

Included

  • Read three known JSON files in this project.
  • Return the fictional business profile.
  • Search the approved fictional service catalogue.
  • Check a town against the recorded service-area list.

Deliberately excluded

  • Real customer, employee, payment, health or identity data.
  • Email, appointments, prices, estimates or payments.
  • File changes, CRM access, databases or web requests.
  • Remote hosting, OAuth or public deployment.

A local MCP startup command runs software on your computer with the privileges of the application that launched it. Read an unfamiliar command and its source before approving it. Here, you build the source and can see every file it reads.

Use fictional information firstThe example business is Cedar Bridge Home Services. Its email ends in .invalid, a domain reserved for examples rather than real delivery.
03

Install the free foundations

These instructions use Windows PowerShell. The project files are the same on macOS or Linux, but paths and install commands differ.

Install Node.js LTSOpen nodejs.org/en/download, choose the current LTS release, run the installer with normal defaults, then close and reopen PowerShell.
Check all three commandsThey must print versions rather than “not recognized.” Node.js 20 or newer is required.
Install a text editorInstall Visual Studio Code or another editor that saves ordinary text files. No paid extension is required.
Create the working folderUse the commands below and confirm the path ends with Documents\business-facts-mcp.
node --version
npm --version
npx --version
Set-Location "$env:USERPROFILE\Documents"
New-Item -ItemType Directory -Name business-facts-mcp
Set-Location .\business-facts-mcp
Get-Location

npm installs project packages. npx can run a package temporarily. If a version command fails, stop here and use the troubleshooting chapter.

04

Create the project and approved information

Run these commands from the empty business-facts-mcp folder. Versions are pinned to the combination that passed this guide’s six-test suite on August 1, 2026.

npm init -y
npm install @modelcontextprotocol/server@2.0.0 zod@4.4.3
npm install -D @modelcontextprotocol/client@2.0.0 @types/node@26.1.2 typescript@7.0.2
New-Item -ItemType Directory -Name src
New-Item -ItemType Directory -Name data
New-Item -ItemType Directory -Name test
code .

If code is not recognized, open Visual Studio Code normally, choose File → Open Folder, and select business-facts-mcp.

Use the complete tested starter

Download, unzip and compare every file. It contains the code, fictional data, pinned packages, build settings, README and six automated checks. Generated packages and compiled output are not included.

Download starter

After setup, the project should have this shape:

business-facts-mcp/ ├─ data/ │ ├─ business.json │ ├─ policies.json │ └─ services.json ├─ src/ │ └─ server.ts ├─ test/ │ └─ server.test.ts ├─ package.json ├─ package-lock.json ├─ tsconfig.json └─ tsconfig.test.json

The JSON files hold the approved facts. The server code controls how those facts may be exposed. A future owner can update an approved service without rewriting the server.

Read before runningOpen the three JSON files and src/server.ts. Confirm that the data is fictional and that no command, web request, secret or write operation is hidden inside the project.
05

Build the server and profile resource

Create src\server.ts or use the starter version. It imports Node’s file reader, the MCP server class, the local STDIO transport and Zod for input validation.

The helper readJson reads only a named file from this project’s data folder. The server instructions explicitly prohibit invented prices, availability, bookings, promises and service areas.

server.registerResource(
  "business-profile",
  "business://profile",
  {
    title: "Approved business profile",
    description: "Fictional public business facts for this learning exercise.",
    mimeType: "application/json",
  },
  async (uri) => {
    const business = await readJson("business.json");
    return {
      contents: [{
        uri: uri.href,
        mimeType: "application/json",
        text: JSON.stringify(business, null, 2),
      }],
    };
  },
);

A resource is reference information a host can read. Reading this profile does not change anything. The complete source file in the starter also registers the tools and starts the transport.

Keep approved facts separate from codeThe server does not “know the business” in a general sense. It reads named files through paths you can inspect.
06

Add two useful read-only tools

A tool accepts structured input and performs one described operation. Zod rejects missing or malformed input before the handler does any work.

search_services

Accepts a short query such as gutter. Returns only matching entries from services.json. Zero matches means “not recorded,” never permission to invent an answer.

check_service_area

Accepts a town such as Clayton. Reports an exact match against the recorded list. A supported town still does not promise availability.

annotations: {
  readOnlyHint: true,
  destructiveHint: false,
  openWorldHint: false,
}

Annotations help a client understand a tool’s consequence. They do not create safety by themselves: the actual handler must remain read-only. The starter handlers read local files, filter or compare values, and return structured results. They do not write files, access a network or contact anyone.

InputExpected server resultBoundary retained
gutterOne recorded service matchNo price or booking
pool repairZero matches and human reviewNo inferred offering
AthensNot on the approved listNo claim about wider service
07

Build it without breaking STDIO

Compile the TypeScript and check that the server file exists:

npm run build
Test-Path .\build\server.js

The build should return to the prompt without an error. The path check should print True.

Do not use console.log() in a STDIO serverStandard output carries MCP’s structured protocol messages. Extra output can corrupt the connection. This server uses console.error() because standard error is separate.

If you run node build\server.js directly, the blank-looking terminal is normal: the server is waiting for an MCP client. Press Ctrl+C to stop it.

Source
src/server.ts
Compiled
build/server.js
Transport
Local STDIO
Network
None
Writes
None
Startup log
Standard error only
08

Test before an AI model is involved

MCP Inspector lets you inspect the resource and tools directly. Run it from the project folder:

npx @modelcontextprotocol/inspector node build/server.js

The first run may download Inspector. A browser window should open; if it does not, open the local address printed in PowerShell.

List and read the resourceOpen Resources, choose List Resources, select business://profile, and confirm Cedar Bridge Home Services is marked fictional.
Exercise both toolsTry gutter, pool repair, Clayton and Athens. Compare results with the table below.
Try a missing fieldRun a tool without its required input. Expect a validation error rather than a guessed value.
Stop InspectorReturn to PowerShell and press Ctrl+C.
CaseExpected
Profile resourceFictional Cedar Bridge profile
gutterOne service match
pool repairZero matches; do not infer
Claytonsupported: true
Athenssupported: false
Missing required fieldValidation error

Run the automated launch check

npm test

A successful run ends with:

# tests 6
# pass 6
# fail 0

Starter verified: six tests passed

This is the observed result from the supplied starter on August 1, 2026. Do not continue to Codex if your local run shows a failure.

09

Install Codex and sign in with ChatGPT

The server and Inspector work without an AI account. Add Codex only after the server has passed its own checks.

Install on Windows

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

The official npm alternative is:

npm install -g @openai/codex

Close and reopen PowerShell, then check:

codex --version
codex login

Choose Sign in with ChatGPT and complete the browser flow. This guide does not use an API key. ChatGPT sign-in uses subscription access when available; API-key sign-in is a separate usage-based path.

codex login status
Treat cached sign-in information like a passwordDo not copy it into this project, a support ticket or a public repository.

Official instructions may change. If the installer behaves differently, use the current OpenAI Codex CLI documentation.

10

Connect Codex and run the Launch Card

Return to the project folder, rebuild, and ask PowerShell for the exact compiled path:

npm run build
$serverPath = (Resolve-Path .\build\server.js).Path
$serverPath
codex mcp add business-facts -- node $serverPath
codex mcp list
codex

The list should show business-facts. Inside Codex, type /mcp and confirm that the server is active.

MCP Server Launch Card

TEST 01Known service“Using only business-facts, what approved service mentions gutters?” Expect the recorded gutter-cleaning service.
TEST 02Unknown serviceAsk about swimming-pool repair. Expect no recorded match and no inferred offering.
TEST 03Supported locationCheck Clayton. Expect a listed town, while availability remains unconfirmed.
TEST 04Unsupported locationCheck Athens. Expect not listed and a human-review next step.
TEST 05Missing informationOmit the town. Expect a request for the required value or validation failure.
TEST 06Outside the jobAsk it to book and email a price. Expect no claim that either external action occurred.
If Codex answers from general knowledgeSay: “Use the business-facts MCP tool and do not rely on outside facts.” Making a tool available does not guarantee a model will choose it for every prompt.
Open printable card
11

Troubleshoot, verify and extend safely

“node,” “npm,” or “npx” is not recognized
Close every terminal and reopen PowerShell. If the version commands still fail, reinstall Node.js LTS and ensure the installer adds Node to the system path.
The TypeScript build reports an error
Read the first error, including its file and line. Compare that file with the starter. Curly quotation marks, missing commas and a file saved under the wrong extension are common copy errors.
Inspector cannot connect
Confirm npm run build succeeded and build\server.js exists. Run Inspector from the project folder. Do not add console.log().
The server does not appear in Codex
Run codex mcp list. If the path is wrong, use the removal command shown by codex mcp --help, rebuild, add the absolute path again, and restart Codex.
The tool appears but Codex does not choose it
Name the server and task explicitly. Check that the description matches what you ask. Tool availability does not guarantee selection for every prompt.
The answer contains an invented business fact
Run the same input in Inspector. If Inspector is wrong, correct the JSON or handler and rerun all tests. If Inspector is correct but surrounding model prose is unsupported, tighten the prompt and server instructions and retain human review.

Advance one boundary at a time

LEVEL 01Fictional local read-only data
LEVEL 02Approved local read-only business data
LEVEL 03One authenticated remote read connection
LEVEL 04One previewed, human-approved write action

Do not jump directly to email sending, live customer data, CRM changes or public hosting. Those steps need identity, authorization, privacy, activity records, error recovery and consequence-specific tests.

A useful MCP server is not the one with the most tools. It is the one whose information, actions and limits the business can explain and test.

Use it alone—or ask for a second pair of eyes

You can complete the guide and use the starter entirely on your own. If another perspective would help, BrainIT can review the boundary, help replace fictional information with approved facts, or plan one carefully controlled next connection.

Visit BrainIT Consulting

Sources and limits

This guide uses current official documentation from the Model Context Protocol project, Node.js, and OpenAI. The package versions passed the included six-test suite on August 1, 2026.

The Launch Card and fictional Customer Inquiry Helper are BrainIT teaching devices. This is general educational guidance, not legal advice, a security certification, or a guarantee that a model or server will behave correctly in every environment.

Emile du Toit · BrainIT Consulting