Skip to main content
Glama
hteek

Serverless MCP

by hteek
mcpFunction.ts1.04 kB
import { Stack } from 'aws-cdk-lib'; import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam'; import { Construct } from 'constructs'; import { BaseNodejsFunction } from '../lambda.js'; export interface McpFunctionProps { readonly domainName: string; } export class McpFunction extends BaseNodejsFunction { constructor(scope: Construct, props: McpFunctionProps) { const { domainName } = props; super(scope, 'Mcp', { nodejsFunctionProps: { environment: { DOMAIN_NAME: domainName, }, }, }); const { account } = Stack.of(this); this.addToRolePolicy( new PolicyStatement({ effect: Effect.ALLOW, actions: [ 'ce:GetCostAndUsage', 'ce:GetCostForecast', 'ce:GetDimensionValues', ], resources: [`arn:aws:ce:us-east-1:${account}:*`], }) ); this.addToRolePolicy( new PolicyStatement({ effect: Effect.ALLOW, actions: ['pricing:*'], resources: ['*'], }) ); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hteek/serverless-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server