# PostgresDatabaseResource.WithPostgresMcp

- Module: [Aspire.Hosting.PostgreSQL](/reference/api/go/aspire.hosting.postgresql.md)
- Defined on: [PostgresDatabaseResource](/reference/api/go/aspire.hosting.postgresql/postgresdatabaseresource.md)
- Version: `17.0.0`
- Kind: `method`

Adds a Postgres MCP server container and configures it to connect to the database represented by `builder`.

## Remarks

The Postgres MCP server is configured to use SSE transport and will expose an HTTP endpoint.
This version of the package defaults to the tag of the container image.

## Definition

```go
type PostgresDatabaseResource interface {
    // ... omitted for brevity
    WithPostgresMcp(options ...*WithPostgresMcpOptions) PostgresDatabaseResource
}
```

## Signature

```go
WithPostgresMcp(options ...*WithPostgresMcpOptions) PostgresDatabaseResource
```

## Parameters

- `options` (`...*WithPostgresMcpOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithPostgresMcpOptions` argument.

- `ConfigureContainer` (`func(obj PostgresMcpContainerResource)`) `callback` -- Configuration callback for the Postgres MCP container resource.
- `ContainerName` (`*string`) -- The name of the container (optional).

## Returns

[`PostgresDatabaseResource`](/reference/api/go/aspire.hosting.postgresql/postgresdatabaseresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [PostgresDatabaseResource](/reference/api/go/aspire.hosting.postgresql/postgresdatabaseresource.md) -- `handle`
