This code was generated in the YouTube video Write Your Own MCP Connetor in Under 50 Lines, which is about using an MCP connector to link your application to AI. By only adding two files to a conventional NodeJS app, we can turn our express server into an MCP server that can serve data directly to Claude.
The MCP server itself is found in mcp.js. This is analogous to the standard server route, except it is configured to work with AI (see the MCP docs). In tools.js, we lay out the different 'routes' that are available to the engaged AI client. This can be likened to a standard API route, wrapped with its own documentation.
To add basic authentication to your MCP server, check out the follow-on YouTube video Are Your MCP Servers Exposed? and its corresponding Git repo Basic MCP Auth.
OhioIoT is an IoT platform designed for small-scale IoT projects. For more, check out our website at www.OhioIoT.com.