# IResourceWithEndpoints.withMcpServer

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md)
- Version: `13.4.0`
- Kind: `method`

Marks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.

## Definition

```typescript
interface IResourceWithEndpoints {
  // ... omitted for brevity
  withMcpServer(
      path?: string,
      endpointName?: string): IResourceWithEndpoints;
}
```

## Signature

```typescript
withMcpServer(
    path?: string,
    endpointName?: string): IResourceWithEndpoints
```

## Parameters

- `path` (`string`) `optional` `= /mcp`
- `endpointName` (`string`) `optional`

## Returns

[IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md) `builder`

## Defined on

- [IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md) -- `interface`
