MCPcopy Index your code
hub / github.com/element-hq/dendrite

github.com/element-hq/dendrite @v0.15.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.15.2 ↗ · + Follow
5,947 symbols 26,897 edges 708 files 1,764 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dendrite

Build status Dendrite Dendrite Dev

Dendrite is a second-generation Matrix homeserver written in Go. It is currently in maintenance mode, meaning only security fixes are being applied, for example room version 12.

It intends to provide an efficient and reliable alternative to Synapse:

  • Efficient: A small memory footprint with better baseline performance than an out-of-the-box Synapse.
  • Reliable: Implements the Matrix specification as written, using the same test suites as Synapse.

Dendrite is beta software, which means:

  • Dendrite is ready for early adopters. We recommend running Dendrite with a PostgreSQL database.
  • Dendrite has periodic releases. We intend to release new versions as we fix bugs and land significant features.
  • Dendrite supports database schema upgrades between releases. This means you should never lose your messages when upgrading Dendrite.

This does not mean:

  • Dendrite is bug-free. It has not yet been battle-tested in the real world and so will be error prone initially.
  • Dendrite is feature-complete. There may be client or federation APIs that are not implemented.
  • Dendrite is ready for massive homeserver deployments. There is no high-availability/clustering support.

Currently, we expect Dendrite to function well for small (10s/100s of users) homeserver deployments as well as P2P Matrix nodes in-browser or on mobile devices.

If you have further questions, please take a look at our FAQ or join us in:

Dendrite does not currently support the following MSCs, which impacts the ability to use Element X with Dendrite servers: - MSC4186: Simplified Sliding Sync - MSC3861: Next-gen auth OIDC

Requirements

See the Planning your Installation page for more information on requirements.

To build Dendrite, you will need Go 1.21 or later.

For a usable federating Dendrite deployment, you will also need:

  • A domain name (or subdomain)
  • A valid TLS certificate issued by a trusted authority for that domain
  • SRV records or a well-known file pointing to your deployment

Also recommended are:

  • A PostgreSQL database engine, which will perform better than SQLite with many users and/or larger rooms
  • A reverse proxy server, such as nginx, configured like this sample

The Federation Tester can be used to verify your deployment.

Get started

If you wish to build a fully-federating Dendrite instance, see the Installation documentation. For running in Docker, see build/docker.

The following instructions are enough to get Dendrite started as a non-federating test deployment using self-signed certificates and SQLite databases:

$ git clone https://github.com/element-hq/dendrite
$ cd dendrite
$ go build -o bin/ ./cmd/...

# Generate a Matrix signing key for federation (required)
$ ./bin/generate-keys --private-key matrix_key.pem

# Generate a self-signed certificate (optional, but a valid TLS certificate is normally
# needed for Matrix federation/clients to work properly!)
$ ./bin/generate-keys --tls-cert server.crt --tls-key server.key

# Copy and modify the config file - you'll need to set a server name and paths to the keys
# at the very least, along with setting up the database connection strings.
$ cp dendrite-sample.yaml dendrite.yaml

# Build and run the server:
$ ./bin/dendrite --tls-cert server.crt --tls-key server.key --config dendrite.yaml

# Create an user account (add -admin for an admin user).
# Specify the localpart only, e.g. 'alice' for '@alice:domain.com'
$ ./bin/create-account --config dendrite.yaml --username alice

Then point your favourite Matrix client at http://localhost:8008 or https://localhost:8448.

Contributing

We would be grateful for any help on issues marked as Are We Synapse Yet. These issues all have related Sytests which need to pass in order for the issue to be closed. Once you've written your code, you can quickly run Sytest to ensure that the test names are now passing.

If you're new to the project, see our Contributing page to get up to speed, then look for Good First Issues. If you're familiar with the project, look for Help Wanted issues.

Copyright & License

Copyright 2017 OpenMarket Ltd Copyright 2017 Vector Creations Ltd Copyright 2017-2025 New Vector Ltd

This software is dual-licensed by New Vector Ltd (Element). It can be used either:

(1) for free under the terms of the GNU Affero General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR

(2) under the terms of a paid-for Element Commercial License agreement between you and Element (the terms of which may vary depending on what you and Element have agreed to). Unless required by applicable law or agreed to in writing, software distributed under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.

Extension points exported contracts — how you extend this code

QueryLatestEventsAndStateAPI (Interface)
Query the latest events and state for a room from the room server. [5 implementers]
roomserver/api/api.go
RelayQueueJSON (Interface)
RelayQueueJSON table contains a map of nid to the raw transaction json. [5 implementers]
relayapi/storage/tables/interface.go
Purge (Interface)
(no doc) [6 implementers]
roomserver/storage/tables/interface.go
QueryAcccessTokenAPI (Interface)
common function for creating authenticated endpoints (used in client/media/sync api) [3 implementers]
userapi/api/api.go
Type (Interface)
Type represents an auth type https://matrix.org/docs/spec/client_server/r0.6.1#authentication-types [3 implementers]
clientapi/auth/user_interactive.go
UploadKeysAPI (Interface)
(no doc) [5 implementers]
clientapi/routing/key_crosssigning.go
Transaction (Interface)
A Transaction is something that can be committed or rolledback. [3 implementers]
internal/sqlutil/sql.go
FederationQueueJSON (Interface)
(no doc) [5 implementers]
federationapi/storage/tables/interface.go

Core symbols most depended-on inside this repo

Errorf
called by 1520
setup/jetstream/log.go
Fatalf
called by 727
setup/jetstream/log.go
Context
called by 662
setup/process/process.go
TxStmt
called by 561
internal/sqlutil/sql.go
ExecContext
called by 398
internal/sqlutil/sql.go
String
called by 359
roomserver/api/input.go
Error
called by 296
clientapi/threepid/invites.go
QueryContext
called by 237
internal/sqlutil/sql.go

Shape

Method 3,140
Function 1,644
Struct 884
Interface 183
TypeAlias 87
FuncType 9

Languages

Go98%
TypeScript2%
Python1%

Modules by API surface

userapi/api/api.go191 symbols
userapi/storage/tables/interface.go113 symbols
roomserver/api/api.go110 symbols
roomserver/storage/tables/interface.go106 symbols
roomserver/storage/interface.go103 symbols
userapi/storage/interface.go98 symbols
roomserver/storage/shared/storage.go97 symbols
syncapi/storage/tables/interface.go93 symbols
userapi/storage/shared/storage.go89 symbols
setup/base/static/client/login/js/jquery-3.4.1.min.js83 symbols
syncapi/storage/interface.go75 symbols
federationapi/storage/tables/interface.go75 symbols

Datastores touched

dendriteDatabase · 1 repos
DendriteDatabaseNameDatabase · 1 repos

For agents

$ claude mcp add dendrite \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact