Getting Started
Although integrations like databases and direct HTTP APIs are supported, they can come with certain limitations - for example, being restricted to querying from a single source at a time. To address this, Infragate introduces custom functions as an additional data source option.
While functions aren’t technically a data source in the traditional sense, within Infragate, we treat them as one. You can define a function once and reuse it across multiple MCP servers, giving you more flexibility and modularity in your integrations.
Infragate uses Deno as the primary runtime environment for these functions.
-
Create an MCP Server
Start by logging into the Infragate Console. Navigate to the “MCP Servers” section and click on “Create Server”. Provide a name for your server, select the desired authorization mode, and choose a deployment region. Click “Create Server” to initialize your MCP server. -
Add a Function Tool
- Once your server is up and running, go to the “Tools” tab and click on “Add Tool”.
- Define the function’s name, description, and parameters as needed. For this example add a single parameter called
nameof typestring. - In the “Tool Type” section, choose “Function” and then select “Create New Function Data Source” under Data Source.
- Give your function a name and proceed to the code editor.
- Leave the default function template as is for now.
interface Request {name: string;}interface Response {message: string;}export async function handler(request: Request): Promise<Response> {const { name } = request;return { message: "Hello " + name };}
- Save the tool to add it to your MCP server.
-
Invoke the Function
- Using MCP Inspector or a client of your choice, use the endpoint of your MCP server to invoke the newly created function tool.
- Pass a value for the
nameparameter to see the function in action.