
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@memberjunction/a2aserver
Advanced tools
This package provides a Google Agent-to-Agent (A2A) protocol server implementation for MemberJunction. It allows MemberJunction to expose its capabilities as an A2A agent, enabling interoperability with other A2A-compliant agents.
A2A is an open protocol developed by Google that enables communication and interoperability between opaque agentic applications. The protocol is designed to facilitate collaboration between AI agents built on different platforms and frameworks.
npm install @memberjunction/a2aserver
The A2A server is configured through your MemberJunction configuration file (mj.config.js or similar). Add the following settings:
// mj.config.js
module.exports = {
// Database configuration
dbHost: 'localhost',
dbPort: 1433,
dbDatabase: 'your_database',
dbUsername: 'your_username',
dbPassword: 'your_password',
dbTrustServerCertificate: false,
dbInstanceName: '', // Optional: SQL Server instance name
mjCoreSchema: '__mj',
databaseSettings: {
connectionTimeout: 15000,
requestTimeout: 15000,
dbReadOnlyUsername: '', // Optional
dbReadOnlyPassword: '', // Optional
},
// A2A Server configuration
a2aServerSettings: {
enableA2AServer: true,
port: 3200,
agentName: "MemberJunction",
agentDescription: "MemberJunction A2A Agent",
streamingEnabled: true,
userEmail: "user@example.com", // Optional: specific user for entity operations
entityCapabilities: [
{
entityName: "*", // Wildcard patterns supported
schemaName: "__mj", // Schema name pattern
get: true,
create: false,
update: false,
delete: false,
runView: true // Enable query operations
},
{
entityName: "User*", // Pattern matching (e.g., Users, UserRoles)
schemaName: "*",
get: true,
create: true,
update: true,
delete: false,
runView: true
}
],
agentCapabilities: [
{
agentName: "*", // Wildcard patterns supported
discover: true,
execute: true,
monitor: true,
cancel: true
},
{
agentName: "Analysis*", // Pattern matching (e.g., AnalysisAgent, AnalysisReportAgent)
discover: true,
execute: true,
monitor: true,
cancel: false
}
]
}
}
enableA2AServer (boolean): Enable/disable the A2A server. Default: falseport (number): Port number for the A2A server. Default: 3200agentName (string): Name of your A2A agent. Default: "MemberJunction"agentDescription (string): Description of your agent. Default: "MemberJunction A2A Agent"streamingEnabled (boolean): Enable SSE streaming responses. Default: trueuserEmail (string, optional): Email of the user context for entity operationsentityCapabilities (array): Configure which entities and operations to exposeagentCapabilities (array): Configure which AI agents and operations to exposeEach capability configuration supports:
entityName (string): Entity name pattern (supports wildcards: *, prefix*, *suffix, *contains*)schemaName (string): Schema name pattern (supports wildcards)get (boolean): Allow retrieving individual recordscreate (boolean): Allow creating new recordsupdate (boolean): Allow updating existing recordsdelete (boolean): Allow deleting recordsrunView (boolean): Allow querying/listing recordsEach agent capability configuration supports:
agentName (string): Agent name pattern (supports wildcards: *, prefix*, *suffix, *contains*)discover (boolean): Allow discovering available agentsexecute (boolean): Allow executing agentsmonitor (boolean): Allow monitoring agent run statuscancel (boolean): Allow cancelling agent runsimport { initializeA2AServer } from '@memberjunction/a2aserver';
// Initialize and start the A2A server
await initializeA2AServer();
// The server will start on the configured port
// Agent card available at: http://localhost:3200/a2a/agent-card
The A2A server exposes the following endpoints:
/a2a/agent-cardReturns the agent card describing capabilities and endpoints.
/a2a/tasks/sendSend a message to create or update a task.
// Request body
{
"taskId": "optional-task-id", // Omit to create new task
"message": {
"parts": [
{
"type": "text",
"content": "Get user with ID 123"
}
]
}
}
// Response
{
"taskId": "generated-task-id",
"status": "pending" | "in_progress" | "completed" | "cancelled" | "failed"
}
/a2a/tasks/sendSubscribeSend a message and subscribe to updates via Server-Sent Events.
/a2a/tasks/:taskIdGet the current status and details of a task.
/a2a/tasks/:taskId/cancelCancel a running task.
// Discover agents
{
"message": {
"parts": [{
"type": "text",
"content": "Discover agents matching 'Analysis*'"
}]
}
}
// Execute agent
{
"message": {
"parts": [{
"type": "data",
"content": {
"operation": "executeAgent",
"agentNameOrId": "DataAnalysisAgent",
"parameters": {
"conversationHistory": [
{ "role": "user", "content": "Analyze sales data for Q4" }
],
"templateData": {
"quarter": "Q4",
"year": 2024
},
"waitForCompletion": true
}
}
}]
}
}
// Check agent run status
{
"message": {
"parts": [{
"type": "data",
"content": {
"operation": "getAgentRunStatus",
"runId": "run-123456"
}
}]
}
}
// Cancel agent run
{
"message": {
"parts": [{
"type": "data",
"content": {
"operation": "cancelAgentRun",
"runId": "run-123456"
}
}]
}
}
// Get operation
{
"message": {
"parts": [{
"type": "text",
"content": "Get Users where ID = 123"
}]
}
}
// Query operation
{
"message": {
"parts": [{
"type": "text",
"content": "Query Employees where Department = 'Sales' order by LastName"
}]
}
}
// Create operation
{
"message": {
"parts": [{
"type": "data",
"content": {
"operation": "create",
"entity": "Users",
"parameters": {
"FirstName": "John",
"LastName": "Doe",
"Email": "john.doe@example.com"
}
}
}]
}
}
// Update operation
{
"message": {
"parts": [{
"type": "data",
"content": {
"operation": "update",
"entity": "Users",
"parameters": {
"ID": "123",
"Email": "newemail@example.com"
}
}
}]
}
}
AgentOperationsHandles all agent-related operations for the A2A server.
Methods:
discoverAgents(pattern?: string): Promise<AgentInfo[]> - Discover available agentsexecuteAgent(agentNameOrId: string, parameters: AgentExecutionParameters): Promise<AgentExecutionResult> - Execute an agentgetAgentRunStatus(runId: string): Promise<AgentRunStatus> - Get agent run statuscancelAgentRun(runId: string): Promise<CancelResult> - Cancel an agent runprocessOperation(operation: string, parameters: any): Promise<OperationResult> - Process any agent operationEntityOperationsHandles all entity-related operations for the A2A server.
Methods:
findEntity(entityName: string): EntityInfo | null - Find an entity by namegetEntity(entityName: string, parameters: OperationParameters): Promise<OperationResult> - Get a single entity by primary keycreateEntity(entityName: string, parameters: OperationParameters): Promise<OperationResult> - Create a new entityupdateEntity(entityName: string, parameters: OperationParameters): Promise<OperationResult> - Update an existing entitydeleteEntity(entityName: string, parameters: OperationParameters): Promise<OperationResult> - Delete an entityqueryEntity(entityName: string, parameters: OperationParameters): Promise<OperationResult> - Query entities with filtersparseCommandFromText(textContent: string): { operation: string, entityName: string, parameters: OperationParameters } - Parse natural language commandsprocessOperation(operation: string, entityName: string, parameters: OperationParameters): Promise<OperationResult> - Process any operationOperationResultinterface OperationResult {
success: boolean;
result?: any;
errorMessage?: string;
}
AgentExecutionParametersinterface AgentExecutionParameters {
conversationHistory?: ChatMessage[];
templateData?: Record<string, any>;
waitForCompletion?: boolean;
}
AgentExecutionResultinterface AgentExecutionResult {
success: boolean;
runId?: string;
status?: string;
returnValues?: any;
errorMessage?: string;
}
AgentRunStatusinterface AgentRunStatus {
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
completedAt?: string;
errorMessage?: string;
}
OperationParametersinterface OperationParameters {
[key: string]: any;
}
@memberjunction/core: Core MemberJunction functionality@memberjunction/global: Global utilities and types@memberjunction/sqlserver-dataprovider: SQL Server data providerexpress: Web server frameworktypeorm: ORM for database operationszod: Schema validationcosmiconfig: Configuration file loaderdotenv: Environment variable supportThe A2A server integrates deeply with MemberJunction's systems:
Entity System:
AI Agent System:
Type Safety: Leverages TypeScript for type-safe operations
The server provides detailed error responses:
{
"error": {
"code": 400 | 404 | 500,
"message": "Descriptive error message"
}
}
Common error scenarios:
npm run build
The package uses ES modules and targets modern JavaScript environments. See tsconfig.json for detailed compiler options.
MIT
FAQs
MemberJunction Agent-To-Agent (A2A) Server Implementation
We found that @memberjunction/a2aserver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.