πŸš€ API Revolution: Model Context Protocol (MCP) Meets Web API

by myonathanlinkedin

149 downloads
Not rated
GitHub

About

This project automates email-based user registration for LLM apps using the Model Context Protocol (MCP). It acts as a simple backend that receives email addresses from users, registers them with an MCP-compatible LLM server, and returns the generated API key or access token.

Details

Author
myonathanlinkedin
Downloads
149
Categories
AI

- Combines MCP with traditional API endpoints for model-based communication
- Built with Domain-Driven Design (DDD) – clear aggregates, entities, and use cases
- Secures registration, login, and password change workflows
- No sensitive Bearer tokens are ever exposed to users
- Extensible and modular – new tools can be added without modifying core
- Uses Serilog for structured logging and clean separation of concerns

Send a POST request to https://localhost:7190/api/Prompt/SendUserPrompt/SendUserPrompt with a JSON body containing a Prompt string. The server internally calls an MCP client, which communicates with an MCP server, and returns the final response. Commands like "register", "login", and "change password" are included in the prompt text.

πŸš€ API Revolution: Model Context Protocol (MCP) Meets Web API

Welcome to MCP Server Tools! 🎯
This project exposes powerful APIs based on the Model Context Protocol (MCP) 🧩, representing a new revolution in API design 🌐 β€” structured, intelligent, and seamlessly extensible.

---

πŸ“š Overview

- πŸ› οΈ Combines Model Context Protocol (MCP) with traditional API endpoints to offer next-generation API experiences.
- πŸ”₯ Redefines API architecture by enabling model-based communication, not just rigid HTTP contracts.
- 🧠 Applies Domain-Driven Design (DDD) at the core: aggregates, entities, and use cases are clearly separated and modeled around business logic.
- πŸ” Secures workflows like registration, login, and password change using industry best practices.
- πŸ§ͺ Extensible and modular β€” new tools can be added easily without modifying the core.
- πŸ“ˆ Built with professional engineering principles: structured logging (via Serilog), robust error handling, clean separation of concerns.

---

🧩 Architecture Flow

Client ➑️ API Endpoint (ASP.NET Core) ➑️ MCP Client ➑️ MCP Server ➑️ Response

βœ… You send a request to our API,
βœ… We internally call the MCP Client,
βœ… MCP Client talks to MCP Server,
βœ… We return the clean final response to the API caller.

In short: You just send simple prompts, we handle everything behind the scenes. 🎩✨

---

πŸ”₯ Example Usage

πŸ“¬ Register a New User

POST to:

https://localhost:7190/api/Prompt/SendUserPrompt/SendUserPrompt

Request body:

{
"Prompt": "hei dawg! my email: jackcorp@test666.com please help me to register"
}

Response:

Great! An email with your login details should be on its way.
Check your inbox for an email from us, containing your email address and password.
Remember to change your password after your first login for added security.
If you don't receive the email, please let me know and we'll try again.

---

πŸ”’ Login and Change Password

POST to:

https://localhost:7190/api/Prompt/SendUserPrompt/SendUserPrompt

Request body:

{
"Prompt": "Bro Server! now please login me email: jackcorp@test666.com and password: d8X9sF & change the password with 123456"
}

Response:

Sure, I'll help you with that.

Now that you're logged in, I'll help you change your password to '123456'.

Your password has been successfully changed. If you have any other requests, feel free to let me know!

---

πŸ› οΈ Tech Stack

- 🧩 Model Context Protocol (MCP)
- ⚑ ASP.NET Core Web API
- 🧠 Domain-Driven Design (DDD) Architecture
- πŸ›‘οΈ Serilog for structured logging
- πŸ› οΈ Clean architecture principles
- ✨ Professional software practices

---

πŸ“Œ Key Highlights

- 🚫 We never expose sensitive Bearer tokens to users.
- 🧠 Designed using DDD-first thinking: domain-driven layers and bounded contexts.
- 🌱 Future-proof and easily extendable.
- 🧹 Clean separation between API, application, and domain logic.

---

πŸ“ License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

---

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.