Registry / database / functional-models-orm-mcp

functional-models-orm-mcp

JSON →
library3.7.1jsnpmunverified

A functional-models-orm datastore provider that implements the Model Context Protocol (MCP) using @modelcontextprotocol/sdk (v3.7.1). Designed for frontend environments, it allows you to use functional-models ORM with MCP-compatible backends. This package wraps the ORM operations (CRUD, queries) as MCP tools, enabling seamless integration with MCP servers. Key differentiators: follows functional-models' functional paradigm, leverages MCP for standardized model access, and is specifically built for frontend usage where direct database access is limited. Release cadence is irregular; latest version 3.7.1.

npm install functional-models-orm-mcp
INSTALL
IMPORT
SIG · FUNCTIONAL-MODELS-
F
functional-models-orm-mcp
databasejavascriptv3.7.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MCPDatastoreProvider
import { MCPDatastoreProvider } from 'functional-models-orm-mcp'
const MCPDatastoreProvider = require('functional-models-orm-mcp').MCPDatastoreProvider
ESM-only; CJS require may not work due to module type.
createMCPClient
import { createMCPClient } from 'functional-models-orm-mcp'
const createMCPClient = require('functional-models-orm-mcp').createMCPClient
ESM-only.
default
import MCP from 'functional-models-orm-mcp'
import { default } from 'functional-models-orm-mcp'
Default export is an object containing MCPDatastoreProvider and createMCPClient.

Demonstrates creating an MCP client, instantiating the provider, defining a model, and performing a create operation.

import { createMCPClient } from '@modelcontextprotocol/sdk/client/index.js'; import { MCPDatastoreProvider } from 'functional-models-orm-mcp'; import { createModel, DataTypes } from 'functional-models-orm'; const client = await createMCPClient({ transport: new StdioClientTransport({ command: 'my-mcp-server' }) }); const provider = new MCPDatastoreProvider({ client, modelNamePrefix: 'myapp' }); const User = createModel('User', { name: DataTypes.string, email: DataTypes.string }); const user = await User.create({ name: 'Alice', email: 'alice@example.com' }); console.log(user.name); // Alice await client.close();
Debug
Known issues
breakingVersion 3.0.0 changed the constructor signature of MCPDatastoreProvider. The 'client' option is now required instead of 'connection'.
fix
Pass a client object (from @modelcontextprotocol/sdk) instead of a connection URL.
affects: >=3.0.0 <3.0.1
deprecatedThe 'createMCPClient' function from this package is deprecated in favor of using the client directly from @modelcontextprotocol/sdk.
fix
Import createMCPClient from '@modelcontextprotocol/sdk/client/index.js' instead.
affects: >=3.5.0
gotchaOnly named exports are available; default export is an object. Attempting `import MCPDatastoreProvider from 'functional-models-orm-mcp'` will fail.
fix
Use `import { MCPDatastoreProvider } from 'functional-models-orm-mcp'`.
affects: >=3.0.0
gotchaThe provider requires a running MCP server; otherwise, operations will throw transport errors.
fix
Ensure the MCP server is started and reachable before creating the provider.
affects: >=1.0.0
breakingVersion 2.0.0 removed the `Connection` class. Use `@modelcontextprotocol/sdk`'s client directly.
fix
Migrate to using the MCP client from the SDK.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: MCPDatastoreProvider is not a constructor
Using default import instead of named import, or using CJS require incorrectly.
fix
Use `import { MCPDatastoreProvider } from 'functional-models-orm-mcp';`
Error: [MCP] Server not connected
MCP client is not connected or server is not running.
fix
Ensure you call `await client.connect(transport)` before creating the provider.
Cannot find module '@modelcontextprotocol/sdk'
Missing peer dependency @modelcontextprotocol/sdk.
fix
Run `npm install @modelcontextprotocol/sdk`
TypeError: client.tools is not a function
Using an older version of the MCP SDK that does not have the 'tools' method.
fix
Upgrade @modelcontextprotocol/sdk to version >=1.0.0
Upgrade
Version history
3.7.1latest on npm
Audit
Dependencies
functional-models-ormrequiredCore ORM dependency for model definitions and datastore operations.
@modelcontextprotocol/sdkrequiredProvides the MCP client/server infrastructure for communication.
Agent activity
7 hits · last 30 days
node
6
Resources
functional-models-orm-mcp — npm install functional-models-orm-mcp · libregistry