<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf" -->

---
title: How to Build a Scholarship Research MCP Server with...
description: A step-by-step tutorial walks through building an MCP (Model Context Protocol) server for scholarship research using Node.js, Express, and MongoDB. The server...
canonical: https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Build a Scholarship Research MCP Server with Node.js, Express, and MongoDB | daily.dev
og:description: A step-by-step tutorial walks through building an MCP (Model Context Protocol) server for scholarship research using Node.js, Express, and MongoDB. The server...
og:url: https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf
og:image: https://api.daily.dev/og/posts/qRpIShMwF.png
og:image:alt: How to Build a Scholarship Research MCP Server with Node.js, Express, and MongoDB
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Build a Scholarship Research MCP Server with Node.js, Express, and MongoDB

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · 26 min read · 4 upvotes · 0 comments

## Summary

A step-by-step tutorial walks through building an MCP (Model Context Protocol) server for scholarship research using Node.js, Express, and MongoDB. The server exposes nine MCP tools (search, match, save, notes, deadlines, compare), resources for reading the catalog, and prompts for generating research plans, so AI hosts like Cursor or Claude Desktop can query a real database instead of relying on hallucinated information. It covers MongoDB schema design, the MCP SDK v2 package split, Streamable HTTP transport via Express, DNS rebinding protections, tool annotations, and connecting the server to Cursor and Claude Desktop.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb>

## Questions this post answers

### How do I set up an MCP server with Express using the SDK v2 packages?

Install @modelcontextprotocol/server for the McpServer class and createMcpHandler, @modelcontextprotocol/express for createMcpExpressApp (which adds JSON parsing and Host/Origin checks against DNS rebinding), and @modelcontextprotocol/node's toNodeHandler to adapt the web-standard fetch handler to Express req/res. Wrap createMcpHandler around a factory function that returns a fresh McpServer per request, since the handler is stateless.

_Developers wiring MCP servers into Express apps can dig deeper into these SDK v2 patterns on daily.dev._

### Why should MCP tools use readOnlyHint and idempotentHint annotations?

These annotations don't change how the SDK executes a tool, but hosts use them to decide how cautious to be, letting a host auto-approve read-only actions like search or get while asking the user before running writes like save or add-note. Idempotent hints, such as on a save tool backed by a unique index, tell the host that repeating a call is safe.

_Anyone designing tool permissions for AI agents can compare annotation strategies like this on daily.dev._

### How should an MCP tool handle a scholarship-not-found error versus an unexpected failure?

Return an isError: true result inside the standard MCP content block for expected domain failures such as a scholarship not being found, and reserve throwing exceptions for genuinely unexpected failures. Zod validation errors never even reach the handler, since the SDK converts invalid arguments into an isError result automatically before the tool code runs.

_Teams building reliable MCP tool responses can review error-handling patterns like this on daily.dev._

## Similar posts on daily.dev

- [Building Custom MCP Servers with Next.js and mcp-handler](https://daily.dev/posts/building-custom-mcp-servers-with-next-js-and-mcp-handler-f6ddpnmik) · Trevor Lasn · 4 upvotes · 0 comments
- [How to Build Your First MCP Server \(2026 Guide\)](https://daily.dev/posts/how-to-build-your-first-mcp-server-2026-guide--rumt2ntru) · Alex CloudStar · 2 upvotes · 1 comments
- [Building MCP Servers: Custom Context for Claude Code](https://daily.dev/posts/building-mcp-servers-custom-context-for-claude-code-iarhgi53v) · SitePoint · 1 upvotes · 0 comments
- [How to Build MCP Servers for Your Internal Data](https://daily.dev/posts/how-to-build-mcp-servers-for-your-internal-data-mal9z290q) · freeCodeCamp · 3 upvotes · 0 comments
- [MCP servers turn Claude into a reasoning engine for your data](https://daily.dev/posts/mcp-servers-turn-claude-into-a-reasoning-engine-for-your-data-gxpgn4shj) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#nodejs](https://daily.dev/tags/nodejs), [#mcp](https://daily.dev/tags/mcp), [#mongodb](https://daily.dev/tags/mongodb), [#express](https://daily.dev/tags/express)

[View this post on daily.dev](https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Build a Scholarship Research MCP Server with Node.js, Express, and MongoDB","url":"https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf"},"datePublished":"2026-09-05T00:03:46.937Z","dateModified":"2026-09-14T06:20:53.836Z","description":"A step-by-step tutorial walks through building an MCP (Model Context Protocol) server for scholarship research using Node.js, Express, and MongoDB. The server...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1cef8db23d2e25c9063b0cce3013ce10?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1cef8db23d2e25c9063b0cce3013ce10?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"freeCodeCamp","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"freeCodeCamp","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1628412854/logos/freecodecamp","url":"https://daily.dev/sources/freecodecamp"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,nodejs,mcp,mongodb,express","timeRequired":"PT26M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"freeCodeCamp","item":"https://daily.dev/sources/freecodecamp"},{"@type":"ListItem","position":3,"name":"How to Build a Scholarship Research MCP Server with Node.js, Express, and MongoDB"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-build-a-scholarship-research-mcp-server-with-node-js-express-and-mongodb-qrpishmwf#faq","mainEntity":[{"@type":"Question","name":"How do I set up an MCP server with Express using the SDK v2 packages?","acceptedAnswer":{"@type":"Answer","text":"Install @modelcontextprotocol/server for the McpServer class and createMcpHandler, @modelcontextprotocol/express for createMcpExpressApp (which adds JSON parsing and Host/Origin checks against DNS rebinding), and @modelcontextprotocol/node's toNodeHandler to adapt the web-standard fetch handler to Express req/res. Wrap createMcpHandler around a factory function that returns a fresh McpServer per request, since the handler is stateless. Developers wiring MCP servers into Express apps can dig deeper into these SDK v2 patterns on daily.dev."}},{"@type":"Question","name":"Why should MCP tools use readOnlyHint and idempotentHint annotations?","acceptedAnswer":{"@type":"Answer","text":"These annotations don't change how the SDK executes a tool, but hosts use them to decide how cautious to be, letting a host auto-approve read-only actions like search or get while asking the user before running writes like save or add-note. Idempotent hints, such as on a save tool backed by a unique index, tell the host that repeating a call is safe. Anyone designing tool permissions for AI agents can compare annotation strategies like this on daily.dev."}},{"@type":"Question","name":"How should an MCP tool handle a scholarship-not-found error versus an unexpected failure?","acceptedAnswer":{"@type":"Answer","text":"Return an isError: true result inside the standard MCP content block for expected domain failures such as a scholarship not being found, and reserve throwing exceptions for genuinely unexpected failures. Zod validation errors never even reach the handler, since the SDK converts invalid arguments into an isError result automatically before the tool code runs. Teams building reliable MCP tool responses can review error-handling patterns like this on daily.dev."}}]}
```

