Class: MCPClient

MCPClient()

MCP Client Class

Constructor

new MCPClient()

Source:

Classes

MCPClient

Methods

(async) fetchCalendarEvents(from, tom, org, akt) → {Promise.<Array>}

Fetch calendar events (upcoming parliamentary activity)

Parameters:
NameTypeDefaultDescription
fromstring

Start date (YYYY-MM-DD)

tomstring

End date (YYYY-MM-DD)

orgstringnull

Optional: Organ filter (e.g., 'kammaren', 'uu', 'fiu')

aktstringnull

Optional: Activity type

Source:
Returns:

Calendar events

Type
Promise.<Array>

(async) fetchCommitteeReports(limit, rm, organ) → {Promise.<Array>}

Fetch latest committee reports (betänkanden)

Parameters:
NameTypeDefaultDescription
limitnumber10

Number of reports to fetch

rmstringnull

Optional: Riksmöte (e.g., '2025/26')

organstringnull

Optional: Committee filter

Source:
Returns:

Committee reports

Type
Promise.<Array>

(async) fetchGovernmentDocuments(searchParams) → {Promise.<Array>}

Fetch government documents (pressmeddelanden, SOU, etc.)

Parameters:
NameTypeDescription
searchParamsObject

Search parameters

Properties
NameTypeDescription
typestring

Document type

titlestring

Title search

dateFromstring

From date

dateTostring

To date

limitnumber

Result limit

Source:
Returns:

Government documents

Type
Promise.<Array>

(async) fetchMPs(filters) → {Promise.<Array>}

Fetch MPs (ledamöter)

Parameters:
NameTypeDescription
filtersObject

Optional filters

Properties
NameTypeDescription
partistring

Party filter

valkretsstring

Electoral district

statusstring

Status filter

limitnumber

Result limit

Source:
Returns:

MPs

Type
Promise.<Array>

(async) fetchMotions(limit, rm) → {Promise.<Array>}

Fetch latest opposition motions

Parameters:
NameTypeDefaultDescription
limitnumber10

Number of motions to fetch

rmstringnull

Optional: Riksmöte

Source:
Returns:

Motions

Type
Promise.<Array>

(async) fetchPropositions(limit, rm) → {Promise.<Array>}

Fetch latest government propositions

Parameters:
NameTypeDefaultDescription
limitnumber10

Number of propositions to fetch

rmstringnull

Optional: Riksmöte

Source:
Returns:

Propositions

Type
Promise.<Array>

(async) fetchVotingRecords(filters) → {Promise.<Array>}

Fetch voting records

Parameters:
NameTypeDescription
filtersObject

Filter parameters

Properties
NameTypeDescription
rmstring

Riksmöte

betstring

Document reference

punktstring

Voting point

Source:
Returns:

Voting records

Type
Promise.<Array>

getStats() → {Object}

Get request statistics

Source:
Returns:

Statistics

Type
Object

(async) initializeSession()

Initialize MCP session for Streamable HTTP transport

Source:

parseSSEResponse()

Parse SSE (text/event-stream) response body into JSON-RPC response

Source:

(async) request(tool, params, retryCount) → {Promise.<Object>}

Make HTTP request to MCP server using JSON-RPC 2.0 protocol

Parameters:
NameTypeDefaultDescription
toolstring

Tool name (e.g., 'get_calendar_events')

paramsObject

Tool parameters

retryCountnumber0

Current retry attempt

Source:
Returns:

Tool response

Type
Promise.<Object>

resetStats()

Reset statistics

Source:

(async) searchDocuments(searchParams) → {Promise.<Array>}

Search riksdag documents

Parameters:
NameTypeDescription
searchParamsObject

Search parameters

Properties
NameTypeDescription
sokstring

Search query

doktypstring

Document type (mot, prop, bet, etc.)

rmstring

Riksmöte

from_datestring

From date

to_datestring

To date

limitnumber

Result limit

Source:
Returns:

Documents

Type
Promise.<Array>

(async) searchSpeeches(searchParams) → {Promise.<Array>}

Search speeches/debates (anföranden)

Parameters:
NameTypeDescription
searchParamsObject

Search parameters

Properties
NameTypeDescription
sokstring

Search query

rmstring

Riksmöte

talarestring

Speaker name

partistring

Party

limitnumber

Result limit

Source:
Returns:

Speeches

Type
Promise.<Array>

(async) sleep()

Sleep utility

Source: