> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Adapters Overview

> Transform external APIs into MCP tools with FrontMCP adapters

Adapters are powerful components that automatically convert external APIs and services into MCP tools. Instead of writing custom tools manually, adapters generate them from specifications like OpenAPI, GraphQL schemas, or database schemas.

## Why Use Adapters?

<CardGroup cols={2}>
  <Card title="Zero Boilerplate" icon="wand-magic-sparkles">
    Generate hundreds of tools from a single specification without writing code for each endpoint.
  </Card>

  <Card title="Type Safety" icon="shield-check">
    Automatic schema validation using Zod ensures type-safe inputs and outputs.
  </Card>

  <Card title="Consistency" icon="layer-group">
    All tools follow the same patterns for authentication, error handling, and validation.
  </Card>

  <Card title="Maintainability" icon="arrows-rotate">
    Update your spec and regenerate tools automatically — no manual updates needed.
  </Card>
</CardGroup>

## Official Adapters

These adapters are maintained by the FrontMCP team and included in `@frontmcp/adapters`.

<CardGroup cols={1}>
  <Card title="OpenAPI Adapter" icon="code" href="/frontmcp/adapters/openapi-adapter">
    Generate MCP tools from OpenAPI 3.x specifications. Perfect for REST APIs with comprehensive documentation.

    **Features:**

    * Multi-provider authentication support
    * Path, query, header, and body parameter handling
    * Request/response validation
    * Filter operations by path or operation ID
    * Custom headers and body mapping

    **Best for:** REST APIs, microservices, third-party integrations
  </Card>
</CardGroup>

<Note>More official adapters are coming soon! GraphQL, gRPC, and database adapters are in development.</Note>

## Community Adapters

Community adapters are created and maintained by the FrontMCP community. While not officially supported, they extend FrontMCP's capabilities to new APIs and services.

<Warning>
  Community adapters are not maintained by the FrontMCP team. Please review the code and security practices before using
  them in production.
</Warning>

### How to Find Community Adapters

<Steps>
  <Step title="Search npm">
    Search for packages tagged with `frontmcp-adapter` or `mcp-adapter`:

    ```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
    npm search frontmcp-adapter
    ```
  </Step>

  <Step title="Check GitHub Topics">
    Browse repositories tagged with [`frontmcp-adapter`](https://github.com/topics/frontmcp-adapter) on GitHub.
  </Step>

  <Step title="Join the Community">
    Visit the [FrontMCP Discussions](https://github.com/agentfront/frontmcp/discussions) to discover and share adapters.
  </Step>
</Steps>

### Featured Community Adapters

<Info>
  This section is for community-contributed adapters. If you've created an adapter, submit a PR to add it here!
</Info>

<CardGroup cols={2}>
  <Card title="Submit Your Adapter" icon="plus" href="https://github.com/agentfront/frontmcp/discussions">
    Created an adapter? Share it with the community! Submit a PR to add your adapter to this page.
  </Card>

  <Card title="Adapter Template" icon="code-branch" href="https://github.com/agentfront/frontmcp/tree/main/libs/adapters">
    Use the official adapter structure as a template for building your own adapters.
  </Card>
</CardGroup>

## Creating Custom Adapters

You can create custom adapters to integrate any API or service with FrontMCP. Adapters are TypeScript classes that implement the adapter interface.

### Basic Adapter Structure

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { BaseAdapter } from '@frontmcp/sdk';

export class MyCustomAdapter extends BaseAdapter {
  async fetch(ctx: ToolContext) {
    // Initialize your adapter
    // Generate tools from your API/service
    // Return array of MCP tools

    return [
      {
        name: 'myTool',
        description: 'Description of the tool',
        inputSchema: {
          type: 'object',
          properties: {
            param1: { type: 'string' },
          },
        },
        execute: async (input) => {
          // Execute the tool
          return { result: 'success' };
        },
      },
    ];
  }

  static init(options: MyAdapterOptions) {
    return new MyCustomAdapter(options);
  }
}
```

### Adapter Best Practices

<AccordionGroup>
  <Accordion title="1. Security First">
    * Never expose credentials in tool inputs
    * Use `authInfo` from context for authentication
    * Validate and sanitize all inputs
    * Document security risk levels
    * Implement proper error handling
  </Accordion>

  <Accordion title="2. Type Safety">
    * Generate Zod schemas from specifications - Validate inputs at runtime - Provide TypeScript types for all options -
      Use strict type checking
  </Accordion>

  <Accordion title="3. Performance">
    * Use lazy loading for specifications - Cache generated tools when possible - Implement connection pooling - Handle
      rate limiting gracefully
  </Accordion>

  <Accordion title="4. Developer Experience">
    * Provide clear documentation - Include working examples - Support common authentication patterns - Add helpful error
      messages - Write comprehensive tests
  </Accordion>

  <Accordion title="5. Maintainability">
    * Follow the official adapter structure
    * Version your adapter properly
    * Document breaking changes
    * Provide migration guides
    * Keep dependencies up to date
  </Accordion>
</AccordionGroup>

### Publishing Your Adapter

When publishing a community adapter:

1. **Package Name:** Use the pattern `@yourscope/frontmcp-adapter-name` or `frontmcp-adapter-name`
2. **Keywords:** Include `frontmcp`, `frontmcp-adapter`, `mcp`, `adapter`
3. **README:** Include installation, usage, examples, and security considerations
4. **License:** Use a permissive license (MIT, Apache 2.0, etc.)
5. **Tests:** Include comprehensive test coverage
6. **TypeScript:** Provide TypeScript types and declarations

```json package.json theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "name": "@yourscope/frontmcp-adapter-myapi",
  "version": "1.0.0",
  "description": "FrontMCP adapter for MyAPI",
  "keywords": ["frontmcp", "frontmcp-adapter", "mcp", "adapter", "myapi"],
  "peerDependencies": {
    "@frontmcp/sdk": "^0.3.0"
  }
}
```

## Adapter Comparison

Choose the right adapter for your use case:

| Adapter     | Best For             | Authentication     | Type Safety    | Complexity  |
| ----------- | -------------------- | ------------------ | -------------- | ----------- |
| **OpenAPI** | REST APIs with specs | Multi-provider     | Auto-generated | Low         |
| **Custom**  | Any API/service      | Fully customizable | Manual schemas | Medium-High |

## Next Steps

<CardGroup cols={3}>
  <Card title="OpenAPI Adapter" icon="book" href="/frontmcp/adapters/openapi-adapter">
    Learn how to use the OpenAPI adapter
  </Card>

  <Card title="Browse Examples" icon="code" href="https://github.com/agentfront/frontmcp/tree/main/apps/demo">
    See adapters in action with real examples
  </Card>

  <Card title="Join Community" icon="users" href="https://github.com/agentfront/frontmcp/discussions">
    Get help and share your adapters
  </Card>
</CardGroup>

## Resources

<CardGroup cols={2}>
  <Card title="SDK Documentation" icon="book-open" href="/frontmcp/getting-started/welcome">
    Learn about the FrontMCP SDK and adapter interfaces
  </Card>

  <Card title="Source Code" icon="github" href="https://github.com/agentfront/frontmcp/tree/main/libs/adapters">
    View the official adapters source code
  </Card>

  <Card title="npm Package" icon="npm" href="https://www.npmjs.com/package/@frontmcp/adapters">
    Install the official adapters package
  </Card>

  <Card title="Contributing Guide" icon="code-pull-request" href="https://github.com/agentfront/frontmcp/blob/main/CONTRIBUTING.md">
    Contribute to FrontMCP adapters
  </Card>
</CardGroup>
