---
alwaysApply: true
---
I'm enlisting you to help me build an MCP server for a SaaS analytics platform called Sigma. My goal is to create another entry point into Sigma, where someone using a chatbot like claude can do things like be directed to sigma assets related to a question, get data-driven answers based on content in sigma and maybe even instruct claude to perform some tasks in sigma.
This MCP server is a prototype that I will host on AWS, so it doesn't need to be production-ready just yet. I want you to create the foundation of the MCP server and then I will implement specific tools and resources in follow up prompts. Here is some information that you may need regarding functionality, the Sigma REST APIs and the overall architecture: Sigma has public API endpoints that I will use to build resources or expose as tools in the MCP.
There are 2 key capabilities I'm thinking of right now:
1. Data Analysis: sigma has an API for exporting data (in CSV, JSON, etc format), and I want to expose this as a tool so that the LLM can fetch data and then analyze it. For the purposes of this project, we should assume that there are just 2-3 datasets that a user might be able to ask a question about. I will limit the amount of data available so size isn't a concern here.
2. Document search: sigma has API endpoints that will list documents (workbooks and datasets) and their metadata (titles, descriptions, contents, etc). When users in the chat bot ask a question like "which workbooks show me customer activity", i want the chatbot to use the information about sigma docs to suggest relevant workbooks to them. These API endpoints for listing documents require many requests per document so it will be necessary to extract and parse the document metadata ahead of time and cache it. Don't worry about updating the metadata yet. For v1, I plan to expose a list of documents to the LLM as a resource and let it choose which one(s) to use.
The Sigma API requires a client ID and a secret to get an access token, then that token will be used for subsequent API requests. I presume these credentials will be stored in AWS secrets manager. For now we will ignore user-level permissions and rate limiting on the API.
I'm thinking that the MCP server should run in a Lambda function with an API gateway around it. It's ok if the Lambda turns off and has to cold start.
For the cached document data, using something like Elasticache / DynamoDB seems like a viable option. Then the Lambda should be able to read from this storage when it spins up.
I want you to provide me some starter/boilerplate code for the MCP server and guidance on setting up the related AWS services based on the information provided. I don't need you to build the specific tools and resources yet.