GPT MCP App - User & Loan Info Tools
An MCP server hosted on AWS Lambda that provides tools for retrieving user profiles and loan details via API Gateway. It enables GPT models to interact with structured user and financial data using the Streamable HTTP transport.
README
GPT MCP App – User & Loan Info Tools
Simple GPT app backend that exposes two MCP tools to GPT via a server running on AWS:
- get_user_info – Retrieve user profile by
user_id - retrieve_loan_info – Retrieve loan details by
loan_id
The backend is an MCP server on AWS Lambda behind API Gateway (HTTP API). GPT (OpenAI Responses API) talks to it using the Streamable HTTP MCP transport.
Project layout
gpt_mcp/
├── src/
│ ├── handler.py # Lambda entrypoint
│ ├── requirements.txt # Lambda deps (for sam build)
│ └── mcp_server/
│ ├── __init__.py
│ └── server.py # MCP server + get_user_info, retrieve_loan_info
├── template.yaml # AWS SAM template (Lambda + HTTP API)
├── requirements.txt # Local dev deps
└── README.md
Run locally (optional)
Create a venv and install deps:
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
The tools use in-memory mock data in server.py. For local testing without Lambda, you can use the MCP Python SDK with stdio or run the Lambda handler via a local Lambda runtime (e.g. SAM CLI).
Deploy to AWS
-
Install AWS SAM CLI
Install the AWS SAM CLI. -
Build and deploy
cd c:\Users\Andrew\Documents\gpt_mcp sam build sam deploy --guidedUse the default stack name (or choose one), set Stage (e.g.
dev), and accept defaults for the rest unless you need a different region or bucket. -
Get the MCP server URL
After deploy, SAM prints the stack outputs. Use the McpApiUrl value, e.g.:
https://<api-id>.execute-api.<region>.amazonaws.com/mcpIf your HTTP API uses the
$defaultstage, the URL might be:https://<api-id>.execute-api.<region>.amazonaws.com/$default/mcpUse the URL that works when you call it from the OpenAI API (see below).
Connect GPT to your MCP server
Use the OpenAI Responses API with the mcp tool type and your deployed URL as server_url. GPT will discover and call get_user_info and retrieve_loan_info from your backend.
Example (Python)
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(
model="gpt-4o", # or another MCP-capable model
tools=[
{
"type": "mcp",
"server_label": "gpt-app",
"server_description": "User and loan info for the GPT app.",
"server_url": "https://<your-api-id>.execute-api.<region>.amazonaws.com/mcp",
"require_approval": "never",
}
],
input="What is the balance for loan_001?",
)
print(resp.output_text)
Example (curl)
curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o",
"tools": [{
"type": "mcp",
"server_label": "gpt-app",
"server_description": "User and loan info.",
"server_url": "https://<your-api-id>.execute-api.<region>.amazonaws.com/mcp",
"require_approval": "never"
}],
"input": "Get user info for user_001"
}'
Replace https://<your-api-id>.execute-api.<region>.amazonaws.com/mcp with your McpApiUrl from the SAM deploy output.
-
ChatGPT / GPT in the OpenAI UI
Remote MCP is used via the Responses API (or products built on it). In the ChatGPT UI you typically use Actions/connectors; for a custom backend like this you’d integrate via your own app that calls the Responses API with themcptool and thisserver_url. -
Require approval
Set"require_approval": "always"if you want to approve each tool call; use"never"for automatic calls (only if you trust the MCP server). -
Auth
If you add auth (e.g. API key or OAuth), pass it in the authorization field of the MCP tool config and protect your API Gateway (e.g. Lambda authorizer or API key).
Tools
| Tool | Description | Parameters |
|---|---|---|
get_user_info |
Get user profile by user ID | user_id |
retrieve_loan_info |
Get loan details (balance, terms…) | loan_id |
Mock data in src/mcp_server/server.py includes user_001, user_002, loan_001, and loan_002. Replace _get_user_from_store and _get_loan_from_store with DynamoDB, RDS, or your internal APIs for production.
Security and production
- Auth: Add API Gateway authorization (e.g. IAM, Lambda authorizer, or API key) and/or validate tokens inside the Lambda.
- Data: Do not rely on in-memory data in production; use a real store and restrict access by identity.
- HTTPS: API Gateway provides HTTPS; keep the MCP server URL on HTTPS when configuring GPT.
References
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.